Next Previous Contents

11. _slang_guess_type


Guess the data type that a string represents.


DataType_Type _slang_guess_type (String_Type s)


This function tries to determine whether its argument s represents an integer or a floating point number. If it appears to be neither, then a string is assumed. It returns one of three values depending on the format of the string s:

    Integer_Type     :   If it appears to be an integer
    Double_Type      :   If it appears to be a double
    String_Type      :   Anything else.
For example, _slang_guess_type("1e2") returns Double_Type but _slang_guess_type("e12") returns String_Type.
See Also

integer, string, double

Next Previous Contents