Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Time sheet calculations
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00862910
Message ID:
00862988
Vues:
16
Thanks again Robert,

How do you "set the cursor position to the start of the time area, highlight to end of field"?

Raymond


>Hello Raymond,
>
>Thats what I was talking about with the input structure, one way
>
>Var=DTOT(date())
>
>bind the variable to the input box
>set the cursor position to the start of the time area, highlight to end of field.
>
>Defaults to todays date 12:00, as soon as the user starts typing the existing time is replaced.
>
>Of course, if you write a timeclock routine, you can use the current time :)
>
>Another way to go is to interface with an electronic timeclock, prices have
>come down on these devices.
>
>Bob
>
>>Thanks Robert.
>>
>>How do you use or configure a DateTime field so the user only has the time to enter and no date?
>>
>>Raymond
>>
>>>Hello Raymond,
>>>
>>>Datetime will force users to enter a valid date & time without much checking on your part, as long as the users don't balk at the default input structure. You can also peform math calculation fairly easily.
>>>
>>>If you use a text field HH:MM you need to check the range for hours and minutes, and generally you would convert to a decimal version to do the math.
>>>
>>>EX: 12:30 = 12.50 (divide minutes by 60) and you also have to account for time that breaks over a boundry:
>>>
>>>02:00 - 10:00 = 4.00 (add 12 to the hours if it rolls over)
>>>
>>>I've done it both ways, easier with datetime, users liked entering the text method better, but only because of the code enforcing the input was more flexible because it was custom.
>>>
>>>Bob
>>>
>>>>What is the best way to do calculations with time?
>>>>
>>>>I have a time sheet to do where the users enter the time started such as 8:30 and the end time such as 13:20.
>>>>Should I use a character field for entry formated 99:99 or is a datetime better?
>>>>Are there pre existing functions to do the calculations?
>>>>
>>>>Thanks in advance.
>>>>
>>>>Raymond Larche
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform