Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Time
Message
 
 
À
08/12/2003 20:27:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Re: Time
Divers
Thread ID:
00857037
Message ID:
00857051
Vues:
35
>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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform