Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Click or keypress
Message
De
09/02/2006 08:39:58
 
 
À
09/02/2006 08:12:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Divers
Thread ID:
01094948
Message ID:
01094966
Vues:
10
hi,
thank you, good thinking from you, bad thinking from me.

>>>any new way to write this code under , and at click or keypres is better
>>
>>IF thisform.text2.value=ALLTRIM("Residential") AND thisform.text1.Value <   1    OR thisform.text1.Value>5
>>        =MESSAGEBOX("out of range")
>>            thisform.text1.SetFocus
>>ENDIF
>>IF thisform.text2.value=ALLTRIM("Business") AND thisform.text1.Value < 1 OR     thisform.text1.Value>4
>>       =MESSAGEBOX("out of range")
>>     thisform.text1.SetFocus
>>ENDIF
>>
>>thanks.

>
>Normally you do that in the Valid() method. Or as a last resort in LostFocus().
>
>If ThisForm.Text1 only gets a simple number with a range of 2-4 why don't you change it to a Spinner control setting the Min and Max properties to 2 and 4?
>
>Also when mixing AND and OR comparisons in the same line you have to use parenthesis:
>
>IF a AND (b or c)
>
>else you'll get incorrect results.
>
>As an aside, it is generally better (more self-documenting) to change the name of the controls to something meaningful instead of "text1" and "text2". Makes you program easier to read and understand.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform