quit in app.open

My app does a bit of checking in app.open, and should quit right there is some conditions obtain. I have a quitDialog method I call to put up a message for the user, after which the method does quit.

Does execution actually return from the quit, meaning that quitDialog will return to app.open? In other words, should I put a return after the call to quitDialog? If not needed, it can’t harm, but I wondered whether it is actually needed.

Pretty sure your app will quit right away, will not return from your function, just stop. I think it works like raising an exception (you can actually catch it)

If in doubt step through the code. To be honest I always return after the quit as it seems like the right thing to do.

I think you are asking for trouble by quitting within the app open event. I would add a short period timer with just quit in its action then call that from the open event when necessary. Search the Forum for this issue and I think you’ll find that quitting from the open event is bad juju

In App.Open start a timer and do your checks there. Quitting in App.Open is not a good idea as Roger said.

Could someone tell me what exactly the problem is that occurs when Quit during App.Open goes wrong?
I haven’t ever seen it fail myself. I have seen the workaround in projects from the RealStudio days.

Hello
Tim Streater

I hope I have understood

If there are some conditions to not continue with the execution of the application
What you could do is the following:

If condition then
    MsgBox "the application can not be executed"
    QUIT
Else
    MyStart.ShowModal
End If

And do not use the quitDialog method

Regards

Raul Juarez Pulache

[quote=426482:@Raul Juarez Pulache]Hello
Tim Streater

What you could do is the following:

If condition then
    MsgBox "the application can not be executed"
    QUIT
Else
    MyStart.ShowModal
End If

And do not use the quitDialog method[/quote]

msgbox is enough and very useful for testing, but I’d like to have a proper application-specific dialog in the case of an early exit, with the action button saying “Quit”, so the user is in no doubt.

This appears to be the case; I put a msgbox after the call to my quitDialog method, which never appears, either when debugging or with a compiled app. Which appears to mean I don’t have to put a return (i.e., a return from app.open) after calling my method.

I couldn’t find any thread obviously about avoiding quit in app.open, however.