Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with MAIN program code
Message
From
10/10/2001 13:58:34
 
 
To
10/10/2001 11:29:42
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00566287
Message ID:
00566547
Views:
11
Right, my suggestion was to use a form property and then use the initial form's init event to stop the loading of the app. So in the Load event you would have something like:
Do Form myInitial To This.vAbort
Then in the initial form's Init event:
If This.vAbort Then
  Return .F.
Endif
Then in the Unload event you can CLEAR EVENTS. Returning false in the Init event prevents the form from loading. HTH

>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
>
>
>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
>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.
>
>
>
>
>>-snip-
>>>
>>>This has been a problem most of the day. I originally put this in the MYINITIALFORM.LOAD but had problem with the aborting and grid references again. I really think it needs to be outside MYINITIALFORM but not sure quite where or how. In some other apps I have written, they open to a form that is a system menu. That makes things easier but this app is basically one form and doesn't need a menu for one single item.
>>>
>>>
>>>Suggestions?
>>
>>How about this:
>>
  • Make your system settings form modal, return a value in the Unload event that indicates if the user has populated the required fields.
    >>
  • Call your system settings form from your initial form's Load event, capturing the return value to a property of the form: "do form mysystem to this.ok"
    >>
  • In the Init event of the initial form, check the value of this.ok (returned from the system form) and return .f. if the returned value indicates that the system form was not populated. This will prevent the initial form from loading.
    >>
    >>Make sure you CLEAR EVENTS so that the app closes.
  • Previous
    Reply
    Map
    View

    Click here to load this message in the networking platform