Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checkbox Value - Logical or Integer?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00881039
Message ID:
00881052
Views:
29
This message has been marked as the solution to the initial question of the thread.
Since the checkbox value may be logical .T./.F. or integer 1/0 (set aside the possible NULL),

you can do the universal workaround with
REPLACE logicalfield WITH NOT EMPTY(myCheckBox.Value) FOR criteria etc
I always use EMPTY() function to check the checkbox values and never care of what type of value does the checkbox really have(I also never use the NULLs in checkboxes)

>Hi - although I have been programming in VFP for sometime now, one thing that continues to catch me out is the checkbox control. Can someone reveal the secret!
>
>I use logical fields in my tables to store the value and so I maybe do something like this on one form...
>
>
>REPLACE logicalfield WITH myCheckBox.Value FOR criteria etc
>
>
>and it works just fine in other circumstances I get a data mismatch error because it appears that the mCheckBox.Value is a integer!
>
>Do I have to test for the type of variable in myCheckBox.Value before writing values to my tables or am I missing something?
>
>TIA
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform