|
Post by Johnc on Aug 25, 2018 21:56:56 GMT
ctrl-f doesn't seem to work there. Any other ways to search for a phrase? It would be helpful for a long macro. Tks!
|
|
|
Post by Steve on Aug 26, 2018 23:47:07 GMT
I save my large macro's to a .mmmacro file and edit them with Notepad++. When I'm ready I import them back. Using the 'Macro Editor' isn't great for large macro's.
|
|
|
Post by Johnc on Aug 27, 2018 1:51:52 GMT
oic. thanks Steve! just a very minor inconvenience that I can live with seeing the power of MMM. I actually love to write smaller modular macros and pull them together with macro queue I suppose?? But not sure about parameter passing and flow control between the smaller macros... So I have never tried. Any insights there? Thanks a lot Steve!
|
|
|
Post by Steve on Aug 27, 2018 4:35:08 GMT
Flow control can really only be handled separately in each running instance of MMM. It would be nice to be able to run several macro's at once from one master 'macro console' and have the flow control managed but MMM is not there yet. What I do now is modularize my routines within my macro using FOR RUN like this: <macro line headers> 20 | FOR | EACH | LINE IN | D:\macro\checkstat.mmmacro | RUN <macro line body> 30 | FOR | EACH | LINE IN | D:\macro\redirect.mmmacro | RUN <macro line end> 50 | FOR | EACH | LINE IN | D:\macro\output.mmmacro | RUN
The FOR EACH LINE IN [file] RUN condition runs each macro line within the file. Effectively it's like calling a function or sub.
|
|
|
Post by Johnc on Aug 27, 2018 10:04:56 GMT
This is a great tip that I need Steve! Thanks again! However, I assume that when running checkstat.mmmacro, it has its new set of variables which is different from the main macro and these 2 sets of variables are not interchangeable. Am I right? Tks!
|
|
|
Post by Steve on Aug 27, 2018 22:33:03 GMT
- checkstat.mmmacro1 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER%::+1 2 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER%::+1 3 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER%::+1 4 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER%::+1 5 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER%::+1 6 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER%::+1 7 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER%::+1 8 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER%::+1 9 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER%::+1 10 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER%::+1
- main.mmmacro1 | RUN ACTION | | | | DEFINE INTEGER VARIABLE | %INTEGER%::100 2 | FOR | EACH | LINE IN | D:\macro\checkstat.mmmacro | RUN 3 | RUN ACTION | | | | MESSAGE PROMPT | Value of Integer=%integer%::%integer% Above main.mmmacro calls checkstat.mmmacro. checkstat.mmmacro just adds 10 to the value of %integer%.
When we run main.mmmacro first at line 1 we assign %integer% to 100, at line 2 run checkstat.mmmacro that adds +10 to %integer%, and at line 3 we show the result in a message prompt. The result is 110. main.mmmacro carries the values of the variables because all the macro is handled by main.mmmacro. When the FOR RUN calls checkstat.mmmacro it is handled locally.
|
|