typeOf
| Syntax |
typeOf (value)
|
| Params |
value is an object of any datatype whose type you wish to determine.
|
| Action |
Determines the datatype of value.
|
| Examples |
typeOf (2+2) » long
typeOf (examples.testText)
typeOf (@examples.testText)
The parameter provided is an address; therefore, it is not the type of the object at that location that is returned.
if typeOf (examples.list1) != outlinetype
|
| Notes |
You can use typeOf to determine the datatype of a user entry or of a return value from another script so you can determine if it can and should be coerced, for example. Although typeOf returns a four-character type identifier, you never need to use this information in your scripts. Frontier defines a constant for each of these types. They are stored in the Object Database at system.compiler.language.constants and are also listed in Chapter 1 of the UserTalk Reference Guide. This also means that if you use typeOf in a script where you wish to check the type of an object, you should use the constant value, as in the fifth example, above.
|
| See Also |
sizeOf
|