Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Click or keypress
Message
From
09/02/2006 08:39:58
 
 
To
09/02/2006 08:12:31
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01094948
Message ID:
01094966
Views:
11
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform