Typecast an object to an integer
This function performs a typecast of s from its data type to
an object of Integer_Type. If s is a string, it returns
returns the ascii value of the first character of the string
s. If s is Double_Type, int truncates the
number to an integer and returns it.
int can be used to convert single character strings to
integers. As an example, the intrinsic function isdigit may
be defined as
define isdigit (s)
{
if ((int (s) >= '0') and (int (s) <= '9')) return 1;
return 0;
}
This function is equalent to typecast (s, Integer_Type);
- slangrtl
-
_slang_guess_type,
_typeof,
atof,
char,
double,
integer,
isdigit,
set_float_format,
sscanf,
string,
tolower,
toupper,
typecast,
typeof
|