Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Changes its mind over Checkbox
Message
From
04/07/2006 09:49:53
 
 
To
04/07/2006 07:05:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01133547
Message ID:
01133579
Views:
14
>>>Terry,
>>>
>>>Checkboxes can have 3 values
>>>
>>>if (vartype(m.this.Value) == T_LOGICAL )
>>> TRUE, FALSE or NULL
>>>
>>>else >> Numeric
>>> 0, 1, or 2= null
>>>endif
>>>
>>>If, in your case it can only be true/false or 0/1, use empty(m.this.Value)
>>>
>>>You can force its type to be logical by
>>> (1) binding it to a logical Field, or
>>> (2) if it does not have a controlsource, setting its default value to .T./.F. in the class
>>
>>Hi Greg
>>
>>Yes I knew this (as I indicated in my spiel), and that one can set the default value (as I said I now have done), etc. My beef is that I put the checkbox on the form, wrote code to accommodate it, then it went and changed its data type from T/F to 1/0.
>>
>>Cheers
>>
>>Terry
>
>Terry,
>
>Change your test to if( !empty(...Value) ) instead of if( ...Value ).

Thanks, Greg but what test are you talking about?
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform