Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checkbox.value = 0 or .F.?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00832540
Message ID:
00832976
Vues:
22
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform