fjslan Posted September 23, 2008 Report Share Posted September 23, 2008 THANKS TO KEVIN for providing help in an earlier topic. my GOAL: run a macro "N" number of times and half way throught thru macro I need to input a name+3 digit number "FRANK-001", "FRANK-002, etc currently i am pausing the macro, entering the name manually, resuming the macro Kevin provided me this <REM2:Intialize variable><IVAR2:03:01:0><REM2:><REM2:Get the number of times to repeat><IVAR2:01:02:FEnter the number of times to repeatFFCenter:Center><REM2:Repeat N1 times. Keep a counter in N2.><REP3:01:000001:000001:%N1%:1:02:><REM2:Copy the counter to string variable T1><NMVAR:05:02:0:0000001:0:0000000><REM2:Pad T1 to be 3 characters in length><TMVAR2:14:01:00:003:000:><REM2:Replace the leading spaces with leading 0's><TMVAR2:21:01:01:000:000: 0><REM2:Create T2 with 'frank' followed by a number><TVAR2:02:01:frank%T1%><REM2:><REM2:Create T2 with 'frank' followed by a number><TEXTTYPE:%T2%<ENTER>><ENDREP> My problem is that I do not know where to enter the script into my current macro so that it will work. (do i enter all of it at the beginning or part of it at the beginning? all of it in th emiddle and part in the beginning? you get the idea. Please help Quote Link to comment Share on other sites More sharing options...
kevin Posted September 24, 2008 Report Share Posted September 24, 2008 // Get the number of times to repeat Variable Set Integer %N1% from Prompt // Repeat N1 times. Keep a counter in N2. Repeat Start (Repeat %N1% times) // Copy the counter to string variable T1 Variable Modify Integer: Convert %N2% to text string %T1% // Pad T1 to be 3 characters in length Variable Modify String: Pad Left %T1% // Replace the leading spaces with leading 0's Replace " " with "0" in %T1% // Create T2 with 'frank' followed by a number Variable Set String %T2% "frank%T1%" // Create T2 with 'frank' followed by a number Text Type: %T2%<ENTER> Repeat End If you post the macro in script format then others can read it without having to copy it and paste it into Macro Express. Make it easier for others to help you. Post in script format, embeded in code tags. Quote Link to comment Share on other sites More sharing options...
kevin Posted September 24, 2008 Report Share Posted September 24, 2008 My problem is that I do not know where to enter the script into my current macro so that it will work.(do i enter all of it at the beginning or part of it at the beginning? all of it in th emiddle and part in the beginning? you get the idea. All variables are already 'defined'. If a macro needs a variable set to a specific value you would need to initialize it. But, in the example given, there is no need to initialize it. Put the macro commands in the macro where you need them. The sample was meant as a starting point, not a complete solution. You may want read the variables topic in the help file to and study other macros to see how to use them. The 'samples.mex' file installed in the same folder as the Macro Express program files has several sample macros you can study. You may also want to visit our Shared Macros web page for additional samples. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.