NWatoi

Converts a string to an integer

NetWare Server:4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98
Library:Cross-Platform Localization (LOC*.*)
Service:Internationalization

Syntax

  #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); 
  
  

Pascal Syntax

  uses netwin32 
   
  Function NWatoi 
    (string : pnstr 
  ) : nint;
  

Parameters

string
(IN) Points to the string of digits to be converted into an integer value.

Return Values

0x0000

No digit was converted

non-zero

Value converted from string

Remarks

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.

See Also

NWisdigit