>thank you but...
>
>**********************************
>USE config2
>IF VARTYPE( config2.version ) <> "U"
>
>= MESSAGEBOX("field exist")
>
> else
>= MESSAGEBOX("field does not exist")
>
>endif
>
>
>
>*************************************
>
>If field "version" does not existe it does not display
>the messagebox above
>
>It displays variable not found instead
Moises:
While VARTYPE() is somewhat (trivially) faster than TYPE(), it is also more error-prone. Since it explicitly passes (in your case) the field name as a parameter, if the field name doesn't exist, it will cause "Variable not found" -error. You should only use VARTYPE(
) if you know that the variable/field name exists, which in many cases totally defeats the purpose.
Since I'm generally trying to keep my memory as uncluttered as possible of all kinds of trivial information, I ALWAYS use TYPE(), because it always returns the variable type or "U" as unknown, whether the variable/field name exists or not. Speed issue for me (in this case a fraction of a second difference) is of trivial concern, since I have never ever had a situation where I would call TYPE() in a huge loop where it would make a noticeable difference.
So, I recommend forgetting that VARTYPE() even exists, because sooner or later you are going to get an error with it. Guaranteed.
Pertti