lang • val

Val

Expression = Val ( String )

Convert a string into a boolean, a number or a date, according to the string contents.

The current localization is used for converting numbers and dates. So beware that date, time, decimal and thousands separators change with the language!

The conversion algorithm is the following:

Examples

Print Val("09/06/72 01:00")
09/06/72 01:00:00
Print Val("3.1415")
3.1415
Print Val("-25")
-25
Print Val("&H123abc")  ' &H indicates HEX number
1194684
Print Val("True")
True
Print IsNull(Val("Gambas"))
True

See also