>>Another option is to change the code in your example as follows:
>>
>>
if empty(MyCheckBox.Value)
>> ....
>>endif
>>
>>HTH,
>
>Thanks Hilmar - that would be better than:-)
>
if ((vartype(checkbox.value)="L" and checkbox.value=.t.) or ;
> (vartype(checkbox.value)="N" and checkbox.value=1)) and ;
> !vartype(checkbox.value)="U"
> checkbox=.t.
>endif
>
>It could go on forever
Yes, the code with empty() is definitely simpler, and I used this kind of code in several places. Of course, the idea solution would be to make sure the checkbox has the desired type - but I don't know how to solve the problem you reported, of VFP8 changing the type unexpectedly.
If you do manage to solve this, it seems better to me to keep the code as
if MyCheckBox.Value
...
or
if MyCheckBox.Value = 1
...
depending on whether you desire a logical or a numerical field. In this case, any unexpected change in the type would be quickly caught.
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)