Jump to content
Macro Express Forums

Can't get repeat counter to work


johnboy691
 Share

Recommended Posts

Ok, I don't know why I can't get this to work? I've looked at previous posts and just can't understand what the problem is. I'm sure it's something I'm missing that stands out.

 

What I want to do is have a repeat loop within a repeat loop. The macro will start and the first run through I need it to assign account number 1002 the first time, it will break out of the counter loop within the main loop and go do what it needs to do with that account number. When done it will loop back to the top, the counter will now be 2 and would find the second account number of 1002, break, and do what it needs to do with that account number. So on with successive account numbers.

 

I've included the test scripting so you can more readily tell me what I'm doing wrong. THANKS!

 

<IVAR2:01:01:0000><REP3:01:000001:000001:00010:0:01:><MSD:250><REP3:05:000001:000001:0001:1:01:><TBOX4:T:3:CenterCenter000278000200:000:StartMacro is starting at the beginning of the counter again.><DELAY:3><TBCLOSE:Start><IFVAR2:2:01:1:0000><TEXTTYPE:assign account 1000><TEXTTYPE:<NUMENTER>><BREAK><ENDIF><IFVAR2:2:01:1:0001><TEXTTYPE:Assign account 1002><TEXTTYPE:<NUMENTER>><BREAK><ENDIF><IFVAR2:2:01:1:0002><TEXTTYPE:Assign account 1003><TEXTTYPE:<NUMENTER>><BREAK><ENDIF><IFVAR2:2:01:1:0003><TEXTTYPE:Assign account 1004><TEXTTYPE:<NUMENTER>><BREAK><ENDIF><IFVAR2:2:01:1:0004><TEXTTYPE:Assign account 1005><TEXTTYPE:<NUMENTER>><BREAK><ENDIF><IFVAR2:2:01:1:0005><TEXTTYPE:Assign account 1006><TEXTTYPE:<NUMENTER>><BREAK><ENDIF><IFVAR2:2:01:4:0005><TEXTTYPE:No more accounts, Macro stopped><TEXTTYPE:<NUMENTER>><MSTOP><ENDIF><ENDREP><TEXTTYPE:Repeat has broken all repeats and will start over><TEXTTYPE:<NUMENTER>><ENDREP>

Link to comment
Share on other sites

Your 1st statement initializes N1 to 0 (you don't need to do this since numeric variables are always initialized to 0).

Your 4th statement uses a Repeat with Variable command using N1.

Here's the relevant Help:

"Start Repeat With Variable

This option allows you to repeat a portion of your macro. The number of times

the macro will repeat is based on the value placed in the variable you have selected."

So you've asked the macro to repeat something 0 times, which from your description, is exactly what it's doing! I bet it runs fast <g>!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...