Delete this card command not working in LIvecode 5.5.3

stgoldberg at aol.com stgoldberg at aol.com
Wed Dec 31 17:36:29 EST 2014


I thank Bob Sneider and Eric Corbett for their suggestions below regarding "delete this card" not working. However, the problem appears more complex.  For many years on January 1, I have created a new invoice stack for the new year by deleting the some 2000 cards from the preceding year's stack and using what remains as a template for the new year.  In doing this I used in the stack script a "delete this card" command, repeated x number of times, deleting each old card.  It always worked, but does not work now using the same script. I'm still using LC 5.5.3.

Peculiarly, if a put a button on a card with the script "delete this card" it won't work, but will work if I make the button a group. "Delete this card" also works from the message box.  It doesn't work when called upon from a stack script, including my efforts at timing.  I just found a way around this though by using "delete NEXT card" instead of "delete THIS card" in the stack script. Maybe the change in behavior has to do the newer Mac operating system (10.7.5 and 10.9.5)?

>Stephen Goldberg:If I want to delete a card using the message box in LC 5.5.3 (on Mac 10.9.5) it >works if I type "delete this card" in the message box.  However, I get an error message if I try the >same thing from a button on the card or from a script in the stack.  This didn't used to be the case.

>Bob Sneider: That is because you are deleting the parent object of the object a running 
>script is on. Try sending in time. 

>Eric Corbett: You can not delete a control whose script is still running.

>Try in the button:

>on mouseUp
   >  local tID
   >  put the long I'd of this card into tID
   >  send "deleteMe tID" to me in 1 milliseconds
>end mouseUp

>Then put the deleteMe handler in the stack.

Stephen Goldberg







More information about the use-livecode mailing list