Deleting cards from within themselves.

Peter M. Brigham pmbrig at gmail.com
Mon Feb 16 15:55:12 EST 2015


You have to put the delete card handler in a higher level script in the message path. For instance.

put this into  the stack script:

on deleteMyCard cdID
   delete card id cdID
end deleteMyCard

then put this into the button:

on mouseup
    send ("deleteMyCard" && the short id of this card) to this stack in 0 secs
end mouseup

That way the message gets queued to fire after the script of the button is finished executing. You can't delete an object whose script is still executing.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig


On Feb 16, 2015, at 3:36 PM, Richmond wrote:

> On 16/02/15 22:30, Eric Corbett wrote:
>> use
>> 
>> send "mouseUp" to btn "DELL" of card “INPUTTER” in 1 milliseconds
>> 
> 
> Nope!
> 
>> 
>> 
>> On Feb 16, 2015, at 12:02 PM, Richmond <richmondmathewson at gmail.com> wrote:
>> 
>>> On 16/02/15 21:54, Roger Eller wrote:
>>>> try this:
>>>> 
>>>> click at the loc of btn "DELL" of card "INPUTTER"
>>>> 
>>>> ~Roger
>>> Thanks, but no joy: because that line still has to be inside a script in an object on the card
>>> to be deleted.
>>> 
>>>> 
>>>> On Mon, Feb 16, 2015 at 2:42 PM, Richmond <richmondmathewson at gmail.com>
>>>> wrote:
>>>> 
>>>>> 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
>>>>> 
>>>> _______________________________________________
>>>> 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
>>> 
>>> _______________________________________________
>>> 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
>> _______________________________________________
>> 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
> 
> 
> _______________________________________________
> 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