Deleting several special cards [Solved]
Posted: Wed Jul 22, 2015 5:03 pm
Hi to all,
I'm trying to delete some cards of a stack with the char "-" in their name.
Example of names of cards to delete: "ach-pach" or "ach-rach", etc.
Here is the code:
This code work fine while I'm debugging, but as they are 1621 cards to remove, I put the breakpoints away (normal!)
Now I get an error which says that it can't find the card "uz" for example.
And this card has no "-" in its name ?!?
Any idea what's wrong in that code ?
Thanks in advance, Jean-Paul.
I'm trying to delete some cards of a stack with the char "-" in their name.
Example of names of cards to delete: "ach-pach" or "ach-rach", etc.
Here is the code:
Code: Select all
repeat with bb = 1 to the number of cards
put the short name of card bb into tName
if tName <> "premiereCard" then -- we keep always the card where the script is running
get offset("-",tName)
if IT > "0" then -- "al-mal" for example
delete card tName
end if
end if
end repeat

Now I get an error which says that it can't find the card "uz" for example.
And this card has no "-" in its name ?!?

Any idea what's wrong in that code ?
Thanks in advance, Jean-Paul.