Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Formatting and controlling input of time
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00632053
Message ID:
00632087
Vues:
14
Chris, you might try file#9430 Time Entry TextBox Class in Downloads section,

>Hi - I am trying to facilitate the entry of a time. I need to check it's a valid time though...
>
>When the user clicks the add record button a record is appended to the view and the v_addcalls.lo_datetime gets automatically populated with the current date time...
>
>This is how I populate the textboxes with date and time...
>
>
>with thisform
>.txtDate.value = dtoc(v_addcalls.lo_datetime)
>.txtDate.enabled = .t.
>
>local intHour, intMin, intSec
>
>intHour = iif(hour(v_addcalls.lo_datetime) < 10, "0" + str(hour(v_addcalls.lo_datetime),1,0), str(hour(v_addcalls.lo_datetime),2,0))
>intMin = iif(minute(v_addcalls.lo_datetime) < 10, "0" + str(minute(v_addcalls.lo_datetime),1,0), str(minute(v_addcalls.lo_datetime),2,0))
>intSec = iif(sec(v_addcalls.lo_datetime) < 10, "0" + str(sec(v_addcalls.lo_datetime),1,0), str(sec(v_addcalls.lo_datetime),2,0))
>
>.txtTime.value = intHour + ":" + intMin + ":" + intSec
>.txtTime.enabled = .t.
>
>
>So the time shows as 08:45:15... but the user can change this to whatever time they want - how do I prevent them putting in 67:17:90 for example or 0:0:0 - I have 99:99:99 in the input mask but it still allows 0:0:0
>
>Thanks...
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform