Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP Changes its mind over Checkbox
Message
De
04/07/2006 09:52:47
 
 
À
04/07/2006 09:49:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01133547
Message ID:
01133580
Vues:
16
>>>>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?


The operator/operand type error of your first message

Testing Empty() works on both numeric and logical data types
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform