Documentation Comments
Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.
Reality V15.2 Online Documentation (MoTW) Revision 3
VARTYPE Function (DataBasic) (m618703+vartype_f.htm)
Returns the type of variable, as determined at compilation, as a string.
VARTYPE(variable)
variable A string containing the name of the variable whose type is to be returned. If variable does not evaluate to a string it must be enclosed in quotes.
VARTYPE returns the following string:
type scope {rows {columns}}
where:
typeOne of the following:
V Simple variable or dynamic array.
D Dimensioned array.
U Undefined variable.
scopeThe scope of the variable, as follows:
0 Local.
1 Global common.
>=2 Named common. The value specifies which named common section contains the variable, in order of declaration in the program.
rowsThe number of rows in a dimensioned array.
columnsThe number of columns in a dimensioned array.
type, scope, rows and columns are separated by spaces in the string returned.
See also the descriptions of the VARVAL and VARVALTYPE functions and the VARVALSET statement.
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.