mroth36
Programmer
- Jul 21, 2005
- 27
HOW CAN YOU DETERMINE THE DATA TYPE OF A FIELD OR MEMORY VARIABLE (THE TYPE() FUNCTION IS NOT WORKING FOR ME)?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
test = 42
?Type("test") [green]&& Should give "N"[/green]
VARTYPE() is similar to the TYPE() function, but VARTYPE() is faster and does not require quotation marks to enclose the expression for which the data type is returned.
VARTYPE() returns “U” if you specify a variable that doesn’t exist.
STORE 'Something' to cTemp
?TYPE('cTemp') &&... returns 'C'
?VARTYPE(cTemp) &&... returns 'C'
STORE DATE() TO cDate
?TYPE('cDate') &&... returns 'D'
?VARTYPE(cDate) &&... returns 'D'
? TYPE([_VFP.TestProp]) &&--> Returns "U" as it must be
? VARTYPE(_VFP.TestProp) &&--> Caboom :o))