Beth-
>?VARTYPE(ox.Parent) && blows the 'Parent does not exist' error
>?TYPE('ox.Parent') && returns 'U'
I agree with Çetin that TYPE() is safer in this case. My rule of thumb is this. If in my code I'm sure I'll have a variable, but am not sure what type it is, then I'll use VARTYPE(). If there is a good chance the variable doesn't exist yet (as in your case), then I use TYPE(). It's simplistic but I've found it to be reliable.
To add a note to Çetin's post. For objects, one should be careful about checking just whether their type is "O". It's safer to check a property, say "Name", if it will have one, or add !ISNULL() to the check.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only