Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Prevent a Form loading?
Message
 
To
29/09/1999 08:46:03
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00270267
Message ID:
00270458
Views:
34
Hi Erik,

Couldn't you add a prop called OkToInit and if the load is ok set it to .T.
Then the first line in the init would be:
if NOT OkToInit
   return .F.
endif
or is that a bad way to do it?

>I agree with your reasoning, though. But there are a couple elements of my framework that rely on this, and there is no other elegant way to do it. Example: The form load event calls a procedure that opens all of the tables and views in the DataEnvironment. If something should go wrong here, and for some reason one or more of the tables or views was not available (someone has it exclusively, or this user doesn't have the correct drive mapped), the form needs to be able to abort. This would not work in the init method, because all of the form's controls are already instanciated by the time that the init runs, and if their tables/views are not available, each databound control will throw an error that the form can't handle by shutting down.
Roi
'MCP' Visual FoxPro

In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform