AcidGlow Posted March 17, 2007 Report Share Posted March 17, 2007 I've Macro Express 3.5c and haven't had any "problems" as such untill today.. I'm trying to create a macro that will repeat an "unknown" number of times. I have done so using the Repeat with Variable, command that suites perfectly (imo) however I also need the macro to have an "unknown" number of variables. In this case I've made variable N99 to have value prompted for by the user. It is used in the Repeat With Variable and sets number of loops. I've also used variable N98 as the Counter variable... I need to create a new variable on each loop and have user prompted for an integer value to be stored in the new variable. However I'm unclear as to wether this is possible and how. Any help would be appreciated. Quote Link to comment Share on other sites More sharing options...
iceman Posted March 17, 2007 Report Share Posted March 17, 2007 Have you investigated/tried "Run Macro in Variable"? I wrote the following that demonstrates it: <REM2:This script is limited to a loop of 97.><IVAR2:99:02:FNumber of times to loop? Note: No more than 97.FFCenter:Center><IFVAR2:2:99:4:97><TBOX4:T:1:CenterCenter000278000200:000:LimitationThis program has a limit of 97, and will now abort. Please try again with a lower number.><MSTOP><ENDIF><REM2:N98 - Counter><REP3:05:000001:000001:0099:1:98:><REM2:N99 - Temporary prompting variable to be saved in another (e.g. N1).><REM2:Set your default value that you want the user to see when prompted each time.><REM2: or REM or delete if you want them to see prior entry.><IVAR2:99:01:0><IVAR2:99:01:1><REM2:Prompt><IVAR2:99:02:FNext input value?TTCenter:Center><REM2:Save prompted value in another variable.><REM2:Copy N99 - Temporary prompting variable to next (e.g. N%N98%) using the counter.><REM2:Sample code to put in Run Macro in Variable.><REM2:You can use any code and put it in a text variable.><REM2:I usually put my commands and then copy them and past inside the set string field.><DIS:<NMVAR:07:99:0:0000001:0:0000000><DIS:<TVAR2:99:01:<NMVAR:07:99:0:0000001:0:0000000>><REM2:T99 - Code to run in macro.><TVAR2:99:01:<NMVAR:07:99:0:000000%N98%:0:0000000>><REM2:Run it.><RUNMACVAR:99><REM2:Do whatever else that needs to be done ...><ENDREP><REM2:TEST RESULTS><TBOX4:T:1:CenterCenter000278000200:000:TestN1 %N1% N2 %N2% N3 %N3%> Copy and paste in a new macro and try it with looping 3 times and see the Test Results. Hope it works out for you. Please reply whether it works for you or not. iceman Quote Link to comment Share on other sites More sharing options...
paul Posted March 18, 2007 Report Share Posted March 18, 2007 You want some fun? Then see this topic for how do achieve what you want, but be prepared to lose some brain cells <g>! http://pgmacros.com/community/index.php?sh...st=0entry2931 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.