how to generate a looping number?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
joe88888
Newbie
Posts: 14
Joined: Wed Nov 22, 2006 4:56 pm

how to generate a looping number?

Post by joe88888 » Thu Apr 05, 2007 5:59 am

I want to generate a number in the middle of my script, let say let>this=5, and when after run throught that point one time, the number go down by 1, until this=1 and then go back to 5 again. thank you for any help!

label>firstline
.....
.....
let>this=5
?????
??????

if>this=5,page5
if>this=4,page4
if>this=3,page3
if>this=2,page2
if>this=1,page1
.......
......
label>page5
...
goto>firstline
....
label>page4
...
goto>firstline

label>page3
......

goto>firstline

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Apr 05, 2007 7:10 am

You need to initialise this before the loop and decrement it inside:
Let>this=this-1

Code: Select all

Let>this=5
Label>start
  ..
  .. do something
  ..
  Let>this=this-1
Goto>start
Or better would be to use Repeat/Until
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

joe88888
Newbie
Posts: 14
Joined: Wed Nov 22, 2006 4:56 pm

Post by joe88888 » Thu Apr 05, 2007 6:17 pm

thank you, that works !

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