Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Here we go w/the invalid date value again
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Here we go w/the invalid date value again
Miscellaneous
Thread ID:
00631821
Message ID:
00631821
Views:
53
OK We've been down this road before and now it's bitten us in the arse again, so here goes:

SET("DATE") is SHORT for our application because we specifically do not want to force a date format within our application. According to VFP7's docs this causes any date prior to 01/01/1601 to be an invalid date value and causes an error. We have a need to trap this error for the sake of anticipating a typo on the part of the user (God forbid, right? :) ).

After unsuccessfully trying to trap this error in our form class' Error event, we've gone to using a global error handler to trap the date problem. We're specifically trying to trap error code 2034 (invalid date/datetime value). In the trap, we're throwing up a MESSAGEBOX and ignoring the error with the expectation that execution just continues and the user can attempt to re-enter the date.

What happens is that if we enter a sample date of 01/01/1200 in a form, the messagebox gets fired as expected. However, execution then continues past the READ EVENTS line in our main prog. Then, our form gets unloaded and fires its Unload code and the application terminates. Is there something in the handler we need to add so that this doesn't occur?

We're kind of at our wits end on this one, so any assistance would be greatly appreciated. We can't change our SET DATE setting and we definitely can't have a date typo result in an abnormal termination of the app.

HELP!

Laterness,
Jon
Jon Rosenbaum
Devcon Drummer
Next
Reply
Map
View

Click here to load this message in the networking platform