Error Message
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Error Message
Hi,
Can you tell me what this error message means? Or how I would go about fixing it? The object in question is a field I'm trying to delete. For some reason it won't let me...
stack "C&LMapper": execution error at line n/a (Object: stack locked, or object's script is executing)
Thanks!
Can you tell me what this error message means? Or how I would go about fixing it? The object in question is a field I'm trying to delete. For some reason it won't let me...
stack "C&LMapper": execution error at line n/a (Object: stack locked, or object's script is executing)
Thanks!
Re: Error Message
Hi Laurel,
what did you script and what object is (trying to) executing the script?
Best
Klaus
what did you script and what object is (trying to) executing the script?
Best
Klaus
Re: Error Message
This is the script:
on undogroup
local tLinktoDelete
set the itemdelimiter to tab
put item 3 of line 2 of gLastAction into tLinktoDelete
repeat until lineoffset(tLinktoDelete, gCurrentlinks) =0--repeats until all of the graphic lines are gone
delete graphic line lineoffset(tLinktoDelete, gCurrentlinks) of gCurrentLinks--deletes lines connected to deletednodes
delete line lineoffset(tLinktoDelete, gCurrentlinks) of gCurrentLinks
end repeat
delete field item 3 of line 1 of gLastAction
delete field item 3 of line 2 of gLastAction
end undogroup
It's in the stack script, called by a button. Everything works fine until the last line. That field isn't getting deleted.
on undogroup
local tLinktoDelete
set the itemdelimiter to tab
put item 3 of line 2 of gLastAction into tLinktoDelete
repeat until lineoffset(tLinktoDelete, gCurrentlinks) =0--repeats until all of the graphic lines are gone
delete graphic line lineoffset(tLinktoDelete, gCurrentlinks) of gCurrentLinks--deletes lines connected to deletednodes
delete line lineoffset(tLinktoDelete, gCurrentlinks) of gCurrentLinks
end repeat
delete field item 3 of line 1 of gLastAction
delete field item 3 of line 2 of gLastAction
end undogroup
It's in the stack script, called by a button. Everything works fine until the last line. That field isn't getting deleted.
Re: Error Message
Hmm, no quick idea...
Does adding parens help?
Best
Klaus
Does adding parens help?
Code: Select all
...
delete field (item 3 of line 1 of gLastAction)
delete field (item 3 of line 2 of gLastAction)
end undogroup
Klaus
Re: Error Message
Nope 
However, after some sleuthing I think I know what the problem is. At a different place in the stack script, a "mousedown" is sent to the field I want to delete. If I delete that command, I no longer have the problem. The "mousedown" is crucial at an earlier point, though, so I have to keep that in. Is there anyway to tell an object's script to stop executing? I kind of hoped "mouseup" would undo it but no such luck...

However, after some sleuthing I think I know what the problem is. At a different place in the stack script, a "mousedown" is sent to the field I want to delete. If I delete that command, I no longer have the problem. The "mousedown" is crucial at an earlier point, though, so I have to keep that in. Is there anyway to tell an object's script to stop executing? I kind of hoped "mouseup" would undo it but no such luck...
Re: Error Message
Hi Laurel,

Can't you handle it another way? Maybe wait until the "mousdown" has been executed?
Sorry, need more info...
Best
Klaus
AHA! Well in that case the error is definitively correctlaurpapo wrote:However, after some sleuthing I think I know what the problem is. At a different place in the stack script, a "mousedown" is sent to the field I want to delete. If I delete that command, I no longer have the problem.

Depends on how you created your stack, app and message architecture!laurpapo wrote:The "mousedown" is crucial at an earlier point, though, so I have to keep that in. Is there anyway to tell an object's script to stop executing?
Can't you handle it another way? Maybe wait until the "mousdown" has been executed?
Sorry, need more info...
Well...laurpapo wrote:I kind of hoped "mouseup" would undo it but no such luck...

Best
Klaus
Re: Error Message
Code: Select all
-- only do this if the field has not been deleted
if there is a field "xyzzy" then
send "mouseDown" to field "xyzzy"
end if
Re: Error Message
Hi,
Instead of telling the script to stop running, you can delete the fields after all other handlers have stopped running:
or if that doesn't work
Kind regards,
Mark
Instead of telling the script to stop running, you can delete the fields after all other handlers have stopped running:
Code: Select all
send "delete field (item 3 of line 1 of gLastAction)" to me in 0 millisecs
send "delete field (item 3 of line 2 of gLastAction)" to me in 0 millisecs
Code: Select all
send "delete field" && quote & item 3 of line 1 of gLastAction & quote to me in 0 millisecs
send "delete field" && quote & item 3 of line 2 of gLastAction & quote to me in 0 millisecs
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Error Message
Thank you all for your help! I ended up finding a way around "mouseup" earlier in the script.
Thanks!
Thanks!