Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checkbox.value = 0 or .F.?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00832540
Message ID:
00832976
Views:
21
Well, I just showed that code as a sample that I use EMPTY() function in order to check the value and do not depend on the type of value, that's all.
>Nick,
>
>But that makes all your IFs inverted logic
>
>
>if ( empty( this.Value ) )
>   * false value/unchecked  code
>else
>   * true value/checked code
>endif
>
>
>as a personal choice I think this is clearer:
>
>
>if ( this.Value )
>   * true value/checked code
>else
>   * false value/unchecked  code
>endif
>
>
>plus it avoids the expense of a function call.
>
>>FWIW, I always check my checkboxes values in code with IF EMPTY(mycheckbox.value), so it does not matter at all what whether it is logical or numeric. (BTW, I do not use NULL values for checkboxes - never had to.)
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
Reply
Map
View

Click here to load this message in the networking platform