Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
I've got a stack where I'd like to remove groups of cards, but I keep getting the 'can't delete object' message.
The stack level script is called from a button on the cards to be removed, but the Dictionary says only objects containing the handler can't remove themselves.
on scrubJob
put checkForMultipleJobCards (field "invoice number") into temp
put item 1 of temp into theNumberFound
put item 3 of temp into jobCardList
Answer warning " "&return&" WARNING"&return&return&"You are about to delete the "&thenumberfound& " cards of this job." &return&return & "Do you want to proceed?" with "Scrub 'em" or "Don't proceed"
if it = "Scrub 'em" then
repeat with x = number of lines of jobCardList to 1 step -1
put short id of card (line x of jobCardList) into keepID
set the cantDelete of card id keepID to false
go to card id keepID
delete this card
end repeat
end if
end scrubJob
Hi Santa,
Do you have a preOpenCard or openCard handler on these cards?
You might have to "wait with messages" so they can finish before deleting them.
Other: I hope you made these cards on the fly, as a standalone cannot modify it self. ummm, If a standalone has these cards it can't delete them, on close they'll still be there the next time the standalone is run.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Simon, this stack is not stand alone. I'm designing a Quotation stack for a painter & decorator friend of mine, and the stack needs to be expandable. I thought of using an sql database for the details, but it's a bit beyond me as a beginner. Besides, each card had 360 small fields on it for measurement entry. I wouldn't know where to start!