Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HH:MM Date in Textbox
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00019749
Message ID:
00019767
Views:
35
>>I never needed datetime, so I never really "investigated" this type. I am very surprised how bad it's implemented. There is no FoxPro function to extract time from a datetime. (Or I didn't find it?)
>>
>
>TIME() does this (but the seconds settings I've tried don't seem to work on it).

NO, TIME() returns the current system time in hh:mm:ss format. If you specify a numeric parameter, it returns also the hundredths of seconds. So, if the parameter is a datetime format (which is in fact a number in the database (8 bytes)) it will return the system time in hh:mm:ss.cc format.

>I attempted this with numeric, but it didn't work out too well, the data entry was awkward. I'll give the char idea a try...I don't realy care about the date, as you note below I can always deal with that, it's just the HH:MM input that I really need. The one problem with the IAC is that also time has total H/M restrictions too, like 12 and 60. I guess I can check these too with VAL()...

Yes, you must check each char. Do it with InteractiveChange method. It's fired for each change (e.g. user enters 4 digits, it will be fired 4 times). Of course, you must also check in Valid method. It's a little work here, but your doing it only once for a clss and you'll use it everywhere... isn't OOP great?

>Yes, that sounds good. I thought this project was going to be pretty easy. Famous last words...Thanks for the input.

I just checked datetime type in VFP 5.0. Nothing new from 3.0. It's amazing how many features are missing.

Vlad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform