VARVALTYPE Function
Returns the data type of the current value of a variable.
Syntax
VARVALTYPE(variable {, row {, column}})
Syntax elements
variable A string containing the name of the variable whose data type is to be returned. If variable does not evaluate to a string it must be enclosed in quotes.
row If variable is a dimensioned array, the row number of the required element; if row is not specified, 1 is assumed. This parameter is ignored if the variable is not a vector or a matrix.
column If variable is a dimensioned array, the column number of the required element; if column is not specified, 1 is assumed. This parameter is ignored if the variable is not a matrix.
Operation
VARVALTYPE returns a type character, as follows:
00 Cleared, unassigned variable.
01 Scaled binary number.
02 Short string.
0401 Session handle.
0402 External object handle.
0404 File handle.
0405 Selection list handle.
0406 Index handle.
81 String number.
82 Indirect string.
U Undefined.
A string number is a number that has more digits than can be held in the 48-bit accumulator, excluding the sign bit. In other words, a number greater than 247-1 (140,737,488,355,327). Remember that the effect of scaling means that, for example, at a default precision of 4, the scaled binary number 123 is actually held as 1230000.
An indirect string is any string above 13 characters; that is, more than can be held in a 16-byte DataBasic descriptor, excluding the flag, delimiter and offset bytes.
See also VARTYPE and VARVAL functions, and the VARVALSET statement.
Restrictions
variable need not be a static string, but may instead be resolved at run time via the symbol table. Therefore, if the program is compiled with the BASIC command's S option to suppress the symbol table, the variable cannot be resolved and an UNDEFINED result is always returned.
VARVALTYPE returns 2-byte characters (0401 to 0406) only for Reality v15.1 or later. Prior to this release, only 04 is returned for these types.