>My app uses a checkbox to manage mousemove services. My convention is to use 0 for off and 1 for on.
>
>Somtimes, CheckBox forgets its a number, and VFP messages Operand/Data Type error. And sure enoug, when I look at the state recorded at last "bomb", the checkbox type has changed from numberical to logical.
>
>Maybe I should swith to a true/false application of check box?
>
>Oh yeah, it's VFP-8 and the crash happens inside a treeview mouse move when the question is asked:
>
if MyCheckBox.Value=0
> ....
>endif
>
>Thanks
I had the problem the other way around (in VFP6): If I didn't specify a value, it was sure to be numeric, where I expected it to be logical (logical is more "logical" for T/F questions, isn't it?)
Make sure you assign the correct value in the property sheet, Init() method, etc.
Another option is to change the code in your example as follows:
if empty(MyCheckBox.Value)
....
endif
HTH,
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)