>I am having more difficulty with "stopping" the app. As I mentioned, I do have the SYSTEM form modal and returning a value. I do have the PRG trapping the return and attempting to"
>
>
>if vAbort=.T. then
> clear event
> quit
>endif
>
You didn't say whether this worked or not.
>I also call the SYSTEM form from MYINITIALFORM when a user wants to changes some system settings. It to traps the vAbort with:
>
>
>if vAbort=.T. then
> thisform.release
Insert a RETURN here.
>endif
>
>
>The problem on this call is that the form is NOT releasing.. it is hitting that line and processing through it continuing on with the next line after the ENDIF, thus generating an error when it tries to do something with the missing system information. I know it is hitting the thisform.release because I have put a WAIT WINDOW in the if/endif loop to watch for it.
In addition to what JCF told you, why don't you move the checking of the records in the myinitialform into its .load? You can even create the table there if it's not found, return .f. from the .load if something's awfully wrong etc. You can set thisform.OK to .t. or .f., depending on any tests you may run there, and Return not Thisform.OK from its unload. You may decide to show the form or not etc all from within the form.
Thus you encapsulate the whole logic into that form, and have only two possible outcomes: your system table is OK, or the form returns .f.
Your main.prg logic may be thus be simplified to
do form myinitialform to vAbort
if vAbort
quit
endif
do form mymainform