repeat loop

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!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Glenn Boyce
Posts: 137
Joined: Thu Jul 24, 2008 11:22 pm

repeat loop

Post by Glenn Boyce » Mon Jul 13, 2009 6:05 am

The code below works but I actually want to substitute the m+2 and the m+3 with 2m+1 and 2m+2 and it won't accept it. I've tried putting brackets around it but doesn't seem to help. I have 7 fields that have five lines each that I want to copy data into.
on mouseUp
set itemdelimiter to tab
repeat with n = 1 to tlineNo
repeat with m = 1 to 5
put item m+2 of line n of fld "Blends" && item m+3 of line n of fld "Blends" into line m of fld ("layer" & n)
end repeat
end repeat
end mouseUp

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Mon Jul 13, 2009 7:59 am

Dear Glenn,

if you enter "operator" in the search field of Rev's dictionary, you get a list, which starts with a lot of funny symbols, followed by a relatively short list of words. It would be very useful if you read the documentation for all items in this list, particularly the one for "*" ;-)

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

Glenn Boyce
Posts: 137
Joined: Thu Jul 24, 2008 11:22 pm

Post by Glenn Boyce » Mon Jul 13, 2009 9:54 pm

Hi Mark.

You know I looked at that line of code and thought there's going to be a really simple solution to this and I can't see it even though it's staring me in the face!! Duh! I didin't need to look up the operators. Works fine now. I'd have to say it was pretty late in the day here - well thats my excuse anyway!

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Mon Jul 13, 2009 10:04 pm

Hi Glenn, that's what the ;-) was for. I thought you'd figure it out.

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

Post Reply