Can't get rid of my last image by scripting

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
pderks
Posts: 58
Joined: Sat May 14, 2011 4:25 pm
Location: Krefeld • Deutschland

Can't get rid of my last image by scripting

Post by pderks » Sun Sep 15, 2019 4:58 pm

Hi,

I have built a Slide Show stack, which displays the images of a long image file list.

When resetting the stack, the last shown image is still sitting there: script lines like
set the filename of image XY to empty
set the ID of image XX to 0
are ignored without message: the image keeps its filename and its ID.

However the msg box command "set the filename of image XY to empty" gets executed.

Do I have to delete the image (and to recreate it before next run) ?

Thanks in advance

Peter

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Can't get rid of my last image by scripting

Post by Klaus » Sun Sep 15, 2019 6:06 pm

Hi Peter,

I'm not sure if we are allowed to set any ID to ZERO!?
Does it work if you comment that line out?

Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9385
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Can't get rid of my last image by scripting

Post by richmond62 » Sun Sep 15, 2019 7:21 pm

Well, here we are . . .

, . . I just opened a new stack, 700 x 700 pixels with an image in it "PIC", 600,600
and set it's image source to a rather silly picture on my desktop.

I noticed one of two interesting things:

1. The filename of the image did NOT change when I set its image source.

2. The ID of the image did NOT change when I set its image source.

And, quite frankly, that really doesn't seem relevant.

HOWEVER . . . Boom-Boom-Boom-Ba-Di-Boom!

When I ran this script in a button:

Code: Select all

on mouseUp
   set the fileName of image "PIC" to " "
   end mouseUp
image "PIC" went blank. :D

Mind you, this:

Code: Select all

on mouseUp
   set the fileName of image "PIC" to empty
   end mouseUp
had the same effect.

I was doing this on a Macintosh running MacOS 10.14.6.

So . . .

Question #1: What OS is LiveCode running on with you?

Question #2: Check your code again, and ask yourself if something else might not be b*gg*ring things up.

pderks
Posts: 58
Joined: Sat May 14, 2011 4:25 pm
Location: Krefeld • Deutschland

Re: Can't get rid of my last image by scripting

Post by pderks » Wed Sep 18, 2019 6:35 pm

Thank you, Klaus,
thank you, richmond62.

Peter

Post Reply

Return to “Talking LiveCode”