Repeat....Until

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Repeat....Until

Post by armsys » Sat Feb 08, 2003 4:17 am

Suppose there are two loops in the same script file:


//*---- Loop 1 ----*//
Let>k=0
Repeat>k
Add>k,1
....Do Process A
Until>k,5

//*---- Loop 2 ----*//
Let>k=0
Repeat>k
Add>k,1
....Do Process B
Until>k,5


After completing Process B, the control will be returned to Add>k,1 in the first loop. That's, Macro Scheduler seems to scan the REPEAT command from the beginning of the script. Please correct me if my observation is erroneous. The workaround solution is to avoid using identical counter variable such as "k" in the above sample.

Of course, it's more intuitive to assume that the control should have been returned to the nearest REPEAT, instead of the first REPEAT in the same script file, even though the REPEAT comamdns may have the same counter variable.

Thanks for your feedback in advance.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Sat Feb 08, 2003 8:54 am

Hi,

Same goes for Gotos and Labels. Keep your labels unique.
MJT Net Support
[email protected]

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Sat Feb 08, 2003 10:59 am

Hi Support,

Now your explanation makes more sense. Thanks a lot.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts