Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
@GET.....RANGE equivalent in VFP?
Message
De
09/11/1998 15:08:06
Eric Barnett
Barnett Solutions Group, Inc
Sonoma, Californie, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00155862
Message ID:
00155895
Vues:
28
I think you have to write code in the Valid event of the textbox. You could always create a class to do it for you. Example with dates:

DEFINE CLASS txtValidateDates
dLowDate={}
dHighDate={}

FUNC Valid
LOCAL lValid
lValid=.T.
WITH this
DO CASE
CASE !EMPTY(.dLowDate) .AND. !EMPTY(.dHighDate)
IF .value<.dLowDate{} .OR. .value>.dHighDate
lValid=.F.
ENDIF
CASE !EMPTY(.dHighDate)
IF .value>.dHighDate
lValid=.F.
ENDIF
CASE !EMPTY(.dLowDate)
IF .value<.dLowDate
lValid=.F.
ENDIF
ENDCASE
RETURN lValid
ENDFUNC
ENDDEFINE

Or something to this effect.

Of course, you'd want to put the class in a VCX so you could then drop in on a form and then put values in dLowDate and dHighDate at design time.

>I need to specify a range for a few fields on a form. Is there an equivalent to the RANGE option of the @GET from the 2.x days in VFP? I found the RangeHigh and RangeLow events but these say they only deal with numerics where the RANGE option dealt with alpha, numerics and dates. Any suggestions?
Eric Shaneson
Cutting Edge Consulting
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform