Deleting cards from within themselves.

G.W.Gaich gWolfgang at gaich.de
Mon Feb 16 21:44:41 CET 2015


in the stack script:

on delcd pCd
    delete cd id pCd
end delcd

in the script of the btn of your card:

on mouseUp
    send ("delcd" && the id of this cd) to this stack in 0
end mouseup


Best
Günter


Am 16.02.2015 um 20:42 schrieb Richmond:
> This CANNOT be done, as such.
>
> I am currently working up a moronically simple flashcard program for
> people to learn words in a new language.
>
> It features a card where end-users can add terms.
>
> Now, for every new term a templet card is cloned and 2 fields on the 
> cloned card are filled.
>
> No rocket science round these parts!
>
> HOWEVER . . . there's always one of those . . .
>
> I want a button on each vocab. card that allows chummy to delete that 
> card.
>
> Tried a button with this script:
>
> on mouseUp
>   put the ID of this card into fld "QARD" of card "INPUTTER"
>   send "mouseUp" to btn "DELL" of card "INPUTTER"
> end mouseUp
>
> where button "DELL" contains this:
>
> on mouseUp
>   put fld "QARD" into QARD
>   delete card ID QARD
> end mouseUp
>
> now, clicking directly on button "DELL" deletes the card . .
>
> but clicking the button on the card to be deleted does NOT delete that 
> card because the script in that button
> is still active.
>
> Would be grateful for any ideas on this one.
>
> Richmond.
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list