LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
i don't know how to explain my question so i'll try like this:
i have two list fields, fdl1 and fld2. fld1 contains 8 filenames and fld2 contains 8 names of image controls (image "a", image "b" etc.). I need to set the filenames of images from fld2 to fld1.
i don't want to use
Why couldn't you? Did you get any error messages? There is a bracket missing at the end of your line.
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
repeat for each line sl in fld "fld1"
put sl into thefilename
end repeat
repeat for each line someImage in fld "fld2"
set filename of someImage to thefilename
end repeat
After this it sets the filename of every image to last line of fld "fld2"
What you get is the correct behaviour, as first the first repeat loop is executed and the other one is executed after the first one is finished.. If you are sure that both fields contain the exact amount of lines you could do it like this
local counter
put 0 into counter
repeat for each line theLine in fld "myField1"
add 1 to counter
set the fileName of img (line counter of fld "myField2") to theLine
end repeat
repeat with x = 1 to number of lines of fld "fld1"
set the filename of img (line x of fld "fld2") to ¬
line x of fld "fld1"
end repeat
If not, please explain more.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode