Page 1 of 1

Force Quit - Command

Posted: Mon Dec 19, 2011 11:45 pm
by Tester2
What command does LiveCode give when the app is force-quit? (ie: double clicking the Home button and "x"ing the app...or restarting your phone)

I need to know this so I can set the file "trackCard".

Thanks bunches!

-Tester2

Re: Force Quit - Command

Posted: Tue Dec 20, 2011 4:36 am
by Jellicle
Try "shutdown".

g

Re: Force Quit - Command

Posted: Tue Dec 20, 2011 6:34 pm
by Tester2
Hey Gerry,

I tried "shutdown" and this command is triggered when the app is hibernated (ie: pressing the Home button once), but here is my scenario...

I am setting the file "trackCard" to allow my user to re-open the app to the card they were last on. This is the code I have on my stack script for startup:

set the defaultfolder to specialFolderPath("documents")
/* check if there is or is not a file trackCard*/
if there is not a file "trackCard" then
put "Home" into URL "file:trackCard"
end if

if there is a file "trackCard" then
put URL "file:trackCard" into whichCard
go card whichCard
end if

My issue, however, is when the user force-quits" the app. I am wondering if there is a way that the file 'trackCard' gets reset?

Like, say I restart my phone...is there a way to tell this file to clear itself, so that the app opens as if it was the first time the user opened it?

Thanks.

-Tester2

Re: Force Quit - Command

Posted: Tue Dec 20, 2011 8:52 pm
by Jellicle
Not that I can think of, no. Your app is sandboxed and no outside influence or action can touch it's files.

Gerry

Re: Force Quit - Command

Posted: Fri Dec 23, 2011 8:00 pm
by CALL-151
Hopefully, this problem will go away when Livecode supports multitasking as implemented in iOS. Right now, there's no difference between the two states. As far as your app is concerned, when the user quits your app by pressing the home button, it's the same as if they "force quit". That's why your splash screen appears each time. So technically, the question isn't "how can I tell when the user force quits?", it's "how can I tell when the user doesn't?"