Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Time
Message
 
 
To
08/12/2003 20:27:34
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Re: Time
Miscellaneous
Thread ID:
00857037
Message ID:
00857051
Views:
37
>Does anyone have a control that will validate the input of time?

Why not use three text boxes (or Spinners) - the first allows 0 through 11 (or 23), and the other two allow 0 through 59.

or if you are using just 1 text box (for Version 7 and earlier)
*- Say cEntry = "10:23:45"
iHours = Val( cEntry )  && Stops at the first non numeric character e.g. :
iMinutes = Val( SubStr( cEntry, 4, 2 ))
iSeconds = Val( Right( cEntry, 2 ))
lValidTime = .T.
cErrorHandle = On( "Error" )
On Error lValidTime = .F.
tEntered = DateTime( 2000, 1, 1, iHours, iMinutes, iSeconds )
On Error &cErrorHandle.
Return lValidTime
Or you can use Try Catch in 8.
censored.
Previous
Reply
Map
View

Click here to load this message in the networking platform