Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fixing VFP 7 crash on date entry
Message
From
16/10/2001 14:22:00
 
 
To
16/10/2001 12:51:28
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00569105
Message ID:
00569178
Views:
39
I have a date format dd.mm.yyyy in my computer.
I have a date textbox in a form. Its control source is date field
containing date 01.01.1400

As you suggested, I added the following lines to ON ERROR procedure
IF UPPER(PROGRAM())='READ_EVENTS' AND ERROR()=2034
  RETRY
  ENDIF
If I run my program, a dreaded 2034 error occurs in DO FORM command.
Error hander ignores this. So my form will not open at all.

If I issue a RETRY, it causes the error 2034 to occur again and endless loop will occur.

So neither Ignore nor RETRY does not help.

How to fix ? I cannot check all date fields before opening form!

>There are really 2 issues here. First, the API we use for interpretation of dates with some SET DATE settings does not work for dates prior to 1601. This is design behavior. Secondly, the clearing of READ EVENTS will happen with any error generated through the interface if your error handler defaults to RETURN rather than RETRY for a given error, and the READ EVENTS is the currently executing line of code.
>
>See Microsoft KnowledgeBase article http://support.microsoft.com/support/kb/articles/Q143/2/84.asp for a workaround, which is basically to issue a RETRY if the current line of executing code is READ EVENTS. Alternately, you could call your READ EVENTS in a loop to make your application not exit under these circumstances until you are ready, or in your error handler, you could look at DO nesting level (PROGRAM(-1)) to infer that the READ EVENTS is active.
>
>You may see that the article says it applies to VFP3, but the info is good in all VFP versions. I will have the article updated to indicate this.
>
>I hope this helps!
Andrus
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform