I may have screwed up

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

I may have screwed up

Post by magice » Fri Apr 17, 2009 7:25 pm

I have come to a point in my app where it will no longer let me edit my stack script. When I try it gives me an error saying "Can't set script while it is executing" This is a new error to me, but I suspect that it is the result of some sort of recursive loop. If it means what I think, then the program is constantly executing. Is there a way to interupt execution so I can edit the file, or does this mean I have to go back to an earlier saved version?

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte » Fri Apr 17, 2009 7:50 pm

Hi magice,

are you on Win or Mac. On a mac apple + "." usually aborts a script.

Do you get into that state after closing rev and reopening the stack? If so try locking messages before you open your stack. Click it in the toolbar or type
lock messages

into the messagebox. Make sure to unlock messages after your stack is loaded.

Hope that helps,

Malte

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Post by magice » Fri Apr 17, 2009 8:46 pm

Thank you, what I very stupidly did was use the openCard command to initiate a stack that is locked with the modal command. The window then makes itself invisible. The problem is it would run for every card that opened so after i made it invisible again, it was running in the background called up by the next card. I just needed to use the application browser to call it up again and close it 4 more times then it let me edit it. Important lesson here. If you use the openCard command and only want the script to run once, put it in an if structure that closes itself off from running a second time. :?

massung
Posts: 93
Joined: Thu Mar 19, 2009 5:34 pm

Post by massung » Fri Apr 17, 2009 9:56 pm

Hehe, I had something similar a while ago. I wanted my app to quit when the user closed the card and I did:

Code: Select all

on closeCard
  quit
end closeCard
Which worked wonderfully. Later on I added another card and a script to switch to it on startup. Fun times. Took me a while to suddenly realize what was going on and how to fix it. ;)

Jeff M.

Post Reply