Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where to put startup validation code?
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00733452
Message ID:
00734246
Views:
19
Armin,
Thanks for your feedback and thoughts. Putting the code in the init() worked fine, although I kept getting a "Unknown member ." message on the This.Cleanup() line. I commented out this line and it seems to work fine now. Will I be screwing something up if the Cleanup() does not run? Thanks again,
- Larry




Hi Larry,

>Question: Where should such code best be put in MM (I'm new to MM)?
>I tried putting it in the BeforeReadEvents code, but then the OnShutDown() code fails.

as Chris already mentioned, the application object is a good place. I'd like to recommend that you put that code in the app class PreInitHook() method, but there seems to be an issue that the cleanup code isn't really run in case you're returning .F. from there. I don't know if this could cause any trouble, but IMO, the safer way is to use the Init() at the moment.

*-- YourApplicationClass.Init()

IF NOT FileIsValid()
* display message to user
This.CleanUp()
RETURN .F.
ELSE
RETURN DODEFAULT()
ENDIF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform