>>>>>>>>>>>>>>>
>In a form, I have the formula to check a field X of a table --- if X = "" ...
>It works fine when I run the form in VFP. But it has wrong operant error after I complie it to an exe file.
>Finally I change it to if empty(X) ... then it works fine in both VFP and in its exe file. Does it mean we should use the empty() instead of = "" if we want to check empty field?
>>>>>>>>>>>>>>>
empty(X) works for different types of values, numeric, character, logical.
So X = 0 and empty(X) are the same. But if you test IF X = "" like in your example when it's numeric it will give you the error.