Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
KeyPress and non chars/digits
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01110355
Message ID:
01110494
Views:
12
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform