Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
KeyPress and non chars/digits
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01110355
Message ID:
01110494
Vues:
13
It doesn't look right in my tests. Do you mean InputMask? Did you try to put this entry in a table and bind your textbox to it?

>>Try your class with 8:30 AM (not 08:30 AM).
>>
>That works too, though it would format the final value as 08:30 AM. However, if you like it to result in 8:30, here is the Valid that would format it:
>
>! Update: and Format = "#9:99 AA"
>
>
>>>   *************************************
>>>   FUNCTION Valid
>>>   *************************************
>>>   LOCAL llReturn, lcThisVal, lcStripVal, ltVal, lcTime
>>>   lcThisVal = UPPER(This.Value)
>>>   lcStripVal = CHRTRAN(lcThisVal, ":", "")
>>>   llReturn = .T.
>>>   ltVal = CTOT(lcThisVal)
>>>   IF EMPTY(ltVal)
>>>      llReturn = EMPTY(lcStripVal)
>>>   ELSE
>>>      IF NOT ISDIGIT(ALLTRIM(LEFT(lcStripVal, 2)))
>>>         llReturn = .F.
>>>      ELSE
>>>         lcTime = TTOC(ltVal, 2)
>>>         This.Value = ALLTRIM(LEFT(lcTime, 5) + SUBSTR(lcTime, AT(" ", lcTime)))
>
>           *-S-*[ Keep time displaying only significant digits
>           IF LEFT(This.Value, 1) = "0"
>              This.Value = " " + SUBSTR(This.Value, 2)
>           ENDIF
>           *-S-*]
>
>>>         This.Refresh()
>>>      ENDIF
>>>   ENDIF
>>>   RETURN (llReturn)
>
>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform