delete card, again...

Ken Ray kray at sonsothunder.com
Mon Oct 6 15:08:00 EDT 2003


The problem is probably the ask/answer dialogs. These are scripted
stacks that interpose themselves modally while your script is running,
and if the defaultStack is changed as a result of their intervention,
the "this card" will point somewhere else. This may also be the reason
why it works in MetaCArd but not in Revolution (similar but different
code in each ask/answer dialog).

Try calling the card specifically, as in:

on deleteKey
  put the long id of this card into tCardID
  answer "Suppress this card?" with "Cancel" or "Suppress"
  if it is "suppress" then 
    send "delete this card" to tCardID in 10 milliseconds
  end if
end deletekey

(You may need to "do" the "send" statement if it can't resolve tCardID
properly.)

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/ 

> -----Original Message-----
> From: use-revolution-admin at lists.runrev.com 
> [mailto:use-revolution-admin at lists.runrev.com] On Behalf Of Dom
> Sent: Monday, October 06, 2003 1:38 PM
> To: Liste Rev
> Subject: delete card, again...
> 
> 
> 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
> 
> 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?
> 
> -- 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com 
> http://lists.runrev.com/mailman/listinfo/use-> revolution
> 





More information about the use-livecode mailing list