Correction of previous script:
on deleteImage
put the number of images of this card into tImages
repeat with x = sImages down to 1
if last char of the short name of image x is an integer then — you will then
keep the image you use as basis for the clones
delete image x
end if
end repeat
end
You do need to count down to 1, otherwise the counter x will become greater
than the number of images you have on the card, halfway through the repeat
loop. There is also no need to get the ID (neither the long or short ID) as you
can simply refer to the image by its number (the counter x). The
Rather use the long id. Just the id means your statement resolves to "delete
456" or some such thing.
The other thing you can do is rename the clones as soon as you create them so
you can reference them later.
Bob S
> On Jan 17, 2018, at 14:42 , Tore Nilsen via use-livecode
>
Hi William
First off - the send is outside the repeat but I assume that's an error in
transcribing to the email.
but this works
on mouseUp
local gone, x
repeat with x= 1 to the number of images of this card
if the short name of image x is "ticket" then
put the id of image x
@Tore and @Mark
Thanks!
Works fine now.
greetings,
William
2018-01-18 0:13 GMT+01:00 Mark Wieder via use-livecode <
use-livecode@lists.runrev.com>:
> On 01/17/2018 02:42 PM, Tore Nilsen via use-livecode wrote:
>
> Use short name instead of name, this will script will work:
>>
>
>
On 01/17/2018 02:42 PM, Tore Nilsen via use-livecode wrote:
Use short name instead of name, this will script will work:
Additionally, the way I deal with this is to create a group, then create
the control *in the group*. That way all I have to do is delete the
group and all the child
The property “name” refers to more than “ticket”, it also includes the
description of the control, in your case the name will be “image ticket”.
You also will need to count down from the number of images in order to delete
all of them, otherwise you will run into a situation where x is higher
Hi there,
I have several cloned images and all have the same name: ticket.
Of course there ID is different.
On close card I want to delete them.
How do I delete them all at once?
Wat is wrong with this code?
on mouseup
repeat with x= 1 to the number of images of this card
if the name of image x