4 Replies Latest reply on Apr 25, 2007 11:38 AM by Webangel01

Is this possible?

Hey,

I've been working on repeat statements and I wonder if anyone know if this is possible?

I want to use a repeat statement with two values incrementing each turn. IE X goes up by one and Y goes up by one, but i cant seem to figure out how to put it into the statement. I've tried the statement below but its wrong. The section between the *'s is not recognised.

repeat with x = 1 to 9 *and y = 11 to 21*

Anyone know how I might go about doing this?

Thanks,
Michael
• 1. Re: Is this possible?
You need to nest 2 repeat loops

repeat with x=1 to 9
repeat with y=11 to 21
put "x="&x
put "y="&y
end repeat
end repeat
• 2. Re: Is this possible?
yes but if I do this then the result will be:

while x = 1
y increments from 11 to 21
then x increments to 2
and y increments from 11 to 21 again.
then x increments to 3..... and so on.

you see? I want :

while x =1, y=11
then they both increment at the same time to
x=2 and y=12

can you help?

• 3. Re: Is this possible?
Hi,

Y = 10
repeat with X = 0 to 10

put X
put Y
Y = Y + 1

end repeat

would do.
HTH,
Manno

Webangel01 wrote:
> yes but if I do this then the result will be:
>
> while x = 1
> y increments from 11 to 21
> then x increments to 2
> and y increments from 11 to 21 again.
> then x increments to 3..... and so on.
>
> you see? I want :
>
> while x =1, y=11
> then they both increment at the same time to
> x=2 and y=12
>
> can you help?
>
>
>

--
----------
Manno Bult
http://www.aloft.nl
manno@xs4all.nl
• 4. Re: Is this possible?
yeah thats it, thanks, I just got the same answer from someone else too. thanks again.
Michael