New topic: Restart Application?
<http://forums.realsoftware.com/viewtopic.php?t=34007> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message DrDungeon Post subject: Restart Application?Posted: Fri May 28, 2010 6:49 pm Joined: Thu Jan 03, 2008 11:29 am Posts: 70 Hi all! I was wondering if there's a way an application can re-start itself from in the code? I'm having a problem where, when my program ends it goes back to an options screen. This is on another window. When I hit "resume" - one of my choices - it does go back, but most if not all events will not work - no response from the window or any of its controls if I click anything. I tried re-setting FOCUS, checking for unreturned calls and the like. Its a little convoluted with many calls within calls to subs, exits, a few timers. Works fine except when the program ends as its supposed to and goes back to that options screen and I select to go back to the main window again. (Window1 vs. Window2) Its like the focus to everything is lost. Because of the many ways my app can end, I suspect I may have a recursion-type problem where it is somehow stuck in a procedure - like a timer - that is now off, but perhaps an Exit Sub somewhere is popping back in to the now-zapped timer, which needs to go off, mode=0 Its terribly complicated, but it occurred to me that I really don't need to go back to my options screen, and indeed it would look much nicer to go to my INTRO (splash) screen, which runs a few seconds (re-setting everything in the app), then goes to the options screen. The whole thing could be solved easily if there was some way that the app could re-run itself exactly as if you had exited it and then double-clicked the My Apllication icon. Something similar to the old RUN statement back in DOS days. Anything like this? I'm really stuck here in an otherwise completed app! Thanks!! -Robert Top timhare Post subject: Re: Restart Application?Posted: Fri May 28, 2010 6:57 pm Joined: Fri Jan 06, 2006 3:21 pm Posts: 7831 Location: Portland, OR USA On Windows, you can use code like Code:app.ExecutableFile.Launch quit It doesn't work as well on OSX because it doesn't like starting a second copy of an app. So you have a few more hoops to jump. Top DrDungeon Post subject: Re: Restart Application?Posted: Fri May 28, 2010 7:26 pm Joined: Thu Jan 03, 2008 11:29 am Posts: 70 Ok I solved it!! A single variable I had set to 2 to prevent any clicks anywhere when a certain animation was running was not re-set! I just had to put it back to 0 in two places and bingo! Works like a charm. Thanks anyway for the tip! -Robert Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
