The datatype( function determines what kind of data is in a field or variable: text, number, etc.
This function has one parameter:
name – is the name of the field or variable that you want to determine the type of.
The function returns the type of data from this list: Text, Integer, Float, Binary, Date or Choice.
Here’s an example which checks the AreaCode variable. If it is text, it converts it into a number.
if datatype("AreaCode")="Text" AreaCode=val(AreaCode) endif
Note: The Choice and Date types can only occur if the datatype( function is used with a field as the parameter. Variables cannot contain data of these types (for a date, the data type is Integer).
Note: Panorama 6 and earlier also used Fixed Point data types. These are no longer used.
Note: Panorama 6 and earlier returned Floating Point instead of Float.
|10.0||Updated||Carried over from Panorama 6.0, but now quoting the field or variable name is optional. Also, the function may now return these values: Text, Integer, Float, Binary, Date or Choice.|