delete card, again...

Klaus Major klaus at major-k.de
Mon Oct 6 14:52:00 EDT 2003


Hi Dom,

> Still this problem after deleting a card...
>
> it seems that it is not possible to put a statement *before* a delete
> card command, e.g.
>
> on deletekey
>   answer "Suppress this card?" with "Cancel" or "Suppress"
>   if it is "suppress" then send "delete this card" to this card in 10
> milliseconds
> end deletekey

Your example did ugly things to my version of RR (empty Answer Dialog 
:-(,
so i think the engine is not sure what to dlete from what stack...


Try this:

on deletekey
   put the number of this cd into xyz
   answer "Suppress this card?" with "Cancel" or "Suppress"
   if it is "suppress" then delete card xyz of stack "your stack name 
here"
end deletekey

Works fine here...

Remember that even the last (and then only) card can be deleted,
which means that all controls are GONE...

So be careful not to have a group and that last cd or its history...

I always  check for the num of cds and ask the user to empty
all fields etc... (in my app) in that case...



This is how the RR menuitem does it ;-)

...
set the defaultstack to the topstack
answer "Really yadda?" with "Yes" or "No" or "Maybe?"
if it = "Yes" then delete this cd
...


Here, too, confusion for the engine is being avoided by setting the 
defaultstack...

> Here, I cant' follow Pierre's advice: better to ask a deleting
> permission *before* acting ;->
>
> Nonetheless... in the development environment, menu Object, menu item
> Delete Card, I do have a dialog before card deleting... So, where is 
> the
> trick???
>
> OS 10.2.4
> Rev 2.1
>
> By the way, is there a mean to quit Rev other than force quit
> (OPT-CMD-Esc) in this case?

NO, as i also had to experience ;-)

Hope that helps...


Regards

Klaus Major
klaus at major-k.de
www.major-k.de




More information about the Use-livecode mailing list