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!
command verwijderkaart
answer "remove card selected: hit OK"&cr&\
"not yet selected: hit Cancel, select card, after that hit OK" with Cancel and OK
if it="OK" then
put selectedtext of fld index into tSLT
put lineoffset(tSLT,fld index) into tLO
else
break
end if
go card tSLT
delete this card ----------errormessage, see below
sort lines of fld "index"
end verwijderkaart
errormessage
stack "NAW": execution error at line n/a (Object: stack locked, or object's script is executing)
As far as I may understand I remove the line "go card tSLT": now the errormessage is:
"stack "NAW": execution error at line 31 (Chunk: can't find card), char 4
Have you tested this by stepping through the handler? I am thinking that maybe the reference to the card in field "index" may not be valid, and that there is no card to delete. If you step through, you will see if your navigation really sent you to the right place.
It may not be related to the problem you had originally, but please please get into the habit of putting quotes around object references. They are *not* variables, ie
...
## User a littel delay to give the script the time to finish.
## We use the card number as a paramer for the new handler
put the number of this cd into tNumber
send "delete_card tNumber" to me in 100 milisecs
sort lines of fld "index"
end verwijderkaart
Best
Klaus
P.S.
No need to change your lifestyle, change the way you think and script!
case "deletecard"
global tLO,tSLT
answer "te verwijderen kaart al geselecteerd: klik op OK"&cr&\
"kaart nog niet geselecteerd: klik op Cancel, selecteer de kaart en klik daarna op OK" with Cancel and OK
if it="OK" then
put selectedtext of fld index into tSLT
put lineoffset(tSLT,fld index) into tLO
send "delete_card" to this stack in 1
end if
break