Data Type Conversion


CStr

CSTR - Returns the expression converted to a string datatype (String).
This function converts a Variant to a string formatted according to WRS
When converting a Date type the "ShortDate" format is used as defined in the WRS
When converting Booleans, the resulting text will always be in English (True or False)
This is different to the text obtained from explicit conversion, which does use the WRS language.


If you are converting a boolean value to a string then the True or False is converted to the corresponding WRS language so it may not always be "True" or "False".


CBool

CBOOL - Returns the expression converted to a boolean datatype (Boolean).
This function converts a string (or a number) to a Boolean value
This function will only interpret the English strings "True" and "False" irrespective of your WRS and Windows language version.


CByte, CCur, CDbl, CDec, CInt, CLng, CSng

CBYTE - Returns the expression converted to a byte data type (Byte).
CCUR - Returns the expression converted to a currency data type (Currency).
CDBL - Returns the expression converted to a double data type (Double).
CDEC - Returns the expression converted to a decimal subtype (Variant).
CINT - Returns the expression converted to an integer data type (Integer).
CLNG - Returns the expression converted to a long data type (Long).
CLNGLNG - Returns the expression converted to a longlong (64 bit platform) data type (LongLong)
CSNG - Returns the expression converted to a single data type (Single).
CVAR - Returns the expression converted to a variant data type (Variant).
All of these function can convert a string representation into a numeric data type
The string must be formatted according to WRS
These functions do not recognise date strings or the % character.


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext