NWatoi
Converts a string to an integer
#include <time.h> or #define NWL_EXCLUDE_TIME
#include <stdio.h> or #define NWL_EXCLUDE_FILE
#include <nwlocale.h>
nint N_API NWatoi (
const nstr N_FAR *string);
uses netwin32
Function NWatoi
(string : pnstr
) : nint;
NWatoi returns 0 if any double-byte characters are in the string.
NWatoi coverts a string of digits into an integer value. The syntax of the string must be:
long ::= [isspace]*[sign]digit[digit]*
IMPORTANT:Only decimal integers will work with NWatoi.
Tabs and/or spaces can precede the digits to be converted. A plus (+) or minus (-) sign can immediately precede the digits to be converted. Otherwise, any non-digit character terminates the conversion. Currently no double-byte characters are converted.
If the string cannot be converted to an integer, 0x0000 will be returned.