>aVar = aVal > >cType = TYPE("aVar"), or >cType = VARTYPE (aVar) >>
>X = "Y" && Assign the value "Y" to the variable X >Z = "X" && Assign the value "X" to the variable Z > >lcTypeofVariable = TYPE ("X") && Returns "C" as we'd expect. >lcContainedVariable = EVALUATE (X) && Gives us an error message "Variable 'Y' not found." > >* So, the value of X, which is Y, is evaluated as a variable, which we haven't assigned. > >* Now let's take a look at what happens when we have assigned an underlying value. > >lcTypeofVariable = TYPE ("Z") && Returns "C" -- as we'd expect. >lcContainedVariableValue = EVALUATE (Z) && will contain "Y" >lcTypeofContainedVariable = TYPE ("lcContainedVariable") && Returns "C" > >* Because TYPE does an EVALUATE, we can actually shorten this as follows: >lcTypeofContainedVariable = TYPE (Z) && Note, without quotes > >* This last format is particularly useful. If TYPE can't evaluate a value, it returns "U" for unknown, thus avoiding an error. > >* So, your routine could look like this: > >FUNCTION GetType >PARAMETER tcVariable >LOCAL lcType > > lcType = TYPE ("tcVariable") > IF lcType = "C" > IF TYPE (tcVariable) <> "U" && a variable could refer to any type > lcType = "V" && create our own type value for "variable" > ENDIF > ENDIF > > RETURN lcType >ENDFUNC > >>