Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date Format
Message
 
 
To
07/10/1998 23:20:22
Jim Underwood
Apollo Information Systems, Inc.
Houston, Texas, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00144882
Message ID:
00145593
Views:
26
Hi Jim,

Don't waste your time looking at Set Date.... The format you need is not one you get for free. The following expression will get you what you are looking for:

Padl(Alltrim(Str(Day(Date()))),2,"0")+ ;
"-"+Left(Cmonth(date()),3)+"-"+;
Str(Year(Date()),4)

taking the date and creating the string output is easy. Parsing the string and creating the date is a bit more difficult - but not that much.

The way VFP works, when these type of fields get focus, the raw date format is what displays in the textbox. I gather you don't like this behavior.

I would suggest creating your own TextBox Class that encodes and decodes the entries for the user - properly validating the entry he/she puts in. If you are going to use VFP 6 - Access/Assign methods are a good place to put this type of code.

So, the inputmask and the format properties for the Textbox would be:

99-AAA-9999

and

R

respectively.

You could add a protected property that holds the actual Datetime() field that is being used as the source of data. If you are not using VFP 6 - The Valid() could be used to write the correct DateTime() value back. And, the Refresh() could be used to display the correctly formated data. The Valid() would also handle the validation requirements as well.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform