Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fixing VFP 7 crash on date entry
Message
From
16/10/2001 16:39:00
 
 
To
16/10/2001 16:14:58
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00569105
Message ID:
00569297
Views:
40
I don't need to use dates before 1601.
My problem is that my application sometimes gots dbf files which contains those dates. In VFP 5, they are replaced to empty dates quietly.
After upgrading to VFP 7 this starts to cause errors.

There seems to be two solutions:

1. Convert SET SYSFORMATS settings to SET DATE settings:
issue a SET SYSFORMATS ON, determine date format, issue according SET DATE command.
Which is the simplest way to implement this ?

2. Scan all date fields for dates before 1601 and replace them with some other dates. For large tables this requires too many time so I cannot use this.


>If you want to use system date settings, you must limit your dates to year > 1600. If you want to use dates older than 1601, you must use SET DATE to something other than SHORT or LONG. This is documented in the SET DATE help topic. The API used to format the date according to the Windows date settings has this date range limitation, and you will see it in any development language that uses this API. This goes back to when we introduced SET DATE SHORT/LONG in VFP5.
>
>I'm sorry if this is a big problem in your application. There's not many other options here, this is just how it works...
>
>>My application must use windows date settings, I cannot hard code them.
>>So I have lines
>>
>>SET SYSFORMAT ON
>>SET CENTURY ON
>>
>>in my init code.
>>
>>How to use your suggestion so that this is works with any windows date formats ?
Andrus
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform