Failure understanding Run vs. Edit mode

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
tomcam
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10
Joined: Fri May 20, 2011 7:24 am

Failure understanding Run vs. Edit mode

Post by tomcam » Sun Aug 07, 2016 8:10 pm

Have read through a ton of docs and still have trouble with a very simple concept: when is a stack editable and when isn't it? Am using Community Edition 8.1.0-dp2 Build 14001 and frequently run into this problem:
  • Click Pointer tool to edit a script
  • Make changes to code
  • Click Browse tool to resume running
  • Changes appear in editor but not execution environment
For example, an answer statement is removed from the code but continues to execute.

Likewise am having trouble setting breakpoints in edit mode. Sometimes they show up as gray dots, not red ones, and don't seem to take hold.

Bonus points on how to stop a stack from running completely or, more accurately, to restart a stack completely. Do I really have to suppress messages, then go stack "nameOfYourMainstack"? Isn't there a Stop button somewhere that stops the whole stack? I'm pretty sure this is pilot error but web searches proved fruitless.

Thanks@

jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 489
Joined: Thu Sep 04, 2008 6:23 am

Re: Failure understanding Run vs. Edit mode

Post by jameshale » Mon Aug 08, 2016 1:00 am

In reverse....
A stack is "running" if a script or handler is being executed.
If no script is being executed it isn't really running, it is just sitting there waiting for something to happen.
When you click on the "browse" tool in the IDE you are telling the engine to enable the running of scripts.
When you click on the "pointer" tool you are telling the engine, "Stop, do not run any of my scripts as I want to change stuff."
Now if you do have a script running while you have the browse tool selected pressing 'cmd-.' (Command key and the period character on a Mac keyboard, possibly control-. on a Windows box, dunno about Linux) will usually stop it. The only times it doesn't is if you are currently in a loop and it is blocking the execution of other messages. Do you have any loops running in your code?
Once you have made a change to a script you need to click on the "apply" button to recompile you script. If you don't then your changes are not present in the running script, just your copy showing in the script editor window. This would ex-lain,your persistent 'answer' dialogue. It could also give rise to the thing you are seeing with your breakpoints.

Post Reply