Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Imput Mask = 99:99!!
Message
De
03/09/1998 13:58:56
 
 
À
03/09/1998 13:38:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00132790
Message ID:
00132894
Vues:
13
>Hi Robert --
>
>The following code expands on the premise a bit....this also filters bad time values. I've had fun with this thread. ;-)
>
>KeyPress event code:
>
>
>LPARAMETERS nKeyCode, nShiftAltCtrl
>LOCAL lNoDef
>lNoDef=.F.
>DO CASE
>CASE THIS.SelStart=0
>   IF !(CHR(nKeyCode) $ "01")
>      lNoDef=.T.
>   ENDIF
>CASE THIS.SelStart=1 OR THIS.SelStart=4
>   IF !(CHR(nKeyCode) $ "0123456789")
>      lNoDef=.T.
>   ENDIF
>CASE THIS.SelStart=3
>   IF !(CHR(nKeyCode) $ "012345")
>      lNoDef=.T.
>   ENDIF
>CASE THIS.SelStart=6
>   IF nKeyCode # 65 AND nKeyCode # 80
>      lNoDef=.T.
>   ENDIF
>ENDCASE
>IF lNoDef
>   NODEFAULT
>ENDIF
>
-------
hey john - this is what I have so far...

my format needs to be 99:99!! - that is not working.
-- code starts
LOCAL lNoDef
lNoDef=.F.
DO CASE
CASE THIS.SelStart=0
IF !(CHR(nKeyCode) $ "01")
lNoDef=.T.
ENDIF
CASE THIS.SelStart=1 OR THIS.SelStart=4
IF !(CHR(nKeyCode) $ "0123456789")
lNoDef=.T.
ENDIF
CASE THIS.SelStart=3
IF !(CHR(nKeyCode) $ "012345")
lNoDef=.T.
ENDIF
ENDCASE
IF lNoDef
NODEFAULT
ENDIF

* this handles the AM/PM
if this.selstart = 5 and between(nKeyCode,32,126)
nodefault
if inlist(nKeyCode,asc("A"),asc("a"),asc("P"),asc("p"))
this.value = substr(this.value,1,5) + upper(chr(nKeyCode))+"M"
this.selstart = 7
endif
endif
if this.selstart > 5 and between(nKeyCode,32,126)
nodefault
endif
-- code ends
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform