GB.NumberFromString
Syntax
int GB.NumberFromString ( int option , const char *str , long len , GB_VALUE *value );
Reads a number inside a string and returns it in a GB_VALUE structure.
- option is a combination of the following constant :
- str is the address of the string.
- len is its length.
- value points to a GB_VALUE structure that will receive the result of the conversion.
This function returns a non-zero value if nothing could be read inside the specified string.
- If the string contains an Integer, the type field of the GB_VALUE structure is set to GB_T_INTEGER, and you can cast this structure to a GB_INTEGER to get the value.
- If the string contains a Long, the type field of the GB_VALUE structure is set to GB_T_LONG, and you can cast this structure to a GB_LONG to get the value.
- If the string contains a floating point number, the type field of the GB_VALUE structure is set to GB_T_FLOAT, and you can cast this structure to a GB_FLOAT to get the value.