Duplicate Repeat> variables

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Duplicate Repeat> variables

Post by Bob Hansen » Mon Feb 14, 2005 4:47 pm

I received the following PM today, thought it should be posted here.....
=============================
From: (Name removed for privacy)
To: Bob Hansen
Posted: Mon Feb 14, 2005 10:50 am
Subject: BUG or NO BUG in macro sheduler Quote message
Hi BOB,

May I ask you your opinion about a MACRO SHEDULER script?

What do you think about the following script?

Let>k=0
Repeat>k
Add>k,1
Message>First loop%crLf%Pass %k%
Wait>1
Until>k,5

Message>End of first loop
Wait>2

Let>k=0
Repeat>k
Add>k,1
Message> Second loop%crlf% Pass %k%
Wait>2
Until>k,5

I’ am not so happy with the answer from support:

You've used the same loop counter variable for each loop so the second Until will loop back to the first Repeat. Use different loop counter variables.

The solution from support avoid loop back to the first loop and is so hiding a bug. That’s my opinion.

I would love to have your opinion "BUG or NO BUG"
=======================================
Mr response:

Questions like this should be posted to the general forum so that we all can learn from the discussions. I will reply here, but will also post to general forum.

I think their response is consistent with my understanding of how their compiler works. You need to changd the second Repeat>k to some other variable like Repeat>n.

When the end of routine is completed, the compiler reads the script again, starting from the top. It will then pick up the first instance of Repeat>?.

The same thing happens with Label>, SRT>, Dialog>, etc.

In my opinion, I don't think it is a bug, it is just knowing how the system will respond to the script. Every language has its own differences, but once you understand them, you can work with them.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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