Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Repeating Macro groups
#1
I have a series of macros with the same name (with vairiable): eg.

mac "test1"
mac "test2"
mac "test3"

how do I set up a repeat or loop command that will replace the variable and activate the next macro: eg.

rep
mac "test1"
mac "testconfirm"
mac "testcomplete"

now replace mac "test1" with mac "test2" then when in completes replace with mac "test3"

any advice would be greatly appreciated. Thanks ahead of time.
#2
Here mac is macro name? I think here you should use function instead of macro. Assume, its name is Func294. At the beginning of the function, insert this:

function str's

Here s is local variable that contains the value that is passed by the macro ("test1", "testconfirm", ...). Use s in the function.

The macro would look like this:

rep
,Func294 "test1"
,Func294 "testconfirm"
,Func294 "testcomplete"

Here , are used instead of tabs because tabs would disappear.
#3
I have the macros set up to access different accounts so I need to be able to replace the first account with the second and so on as each series completes.

I just need to know how to change the number at the end of each macro name to the next number in the series. eg "Test1" to "Test2" to "Test3" and so on.

I am still fairly new to using macros and have no idea how to set up a function as you suggested. If there is a simple way to change the number within the macro name, that is all I need. Again thanks for any advice/information offered.
#4
int i
for i 0 3
sel i
case 0 Test1
case 1 Test2
case 2 Test3
testconfirm
testcomplete

Here Test1, Test2, Test3, testconfirm and testcomplete are functions. They must be called as functions, not with mac. If using mac, they will not run synchronously, and maybe will not run at all. If now they are macros (green triangle icon), go to Properties and select Function instead of Macro. Then insert this at the beginning of each:

spe -1

Function names must match case.
#5
Gintaras thanks for the help with this, I do still have one more thing if you or anyone else could help with.

str s="Text"
int i=1
s.from("Text" i)
key (s)
'Y
'Sresponse

this is the sequence I am using within one of the functions to input some text for me. I also need it to loop with an increasing integer. I need the end result to be "Text10" and I need to be able to include the second line of text within the loop.

So the end result will be:

Text1
Response

Text2
Response

Text3
Response
#6
Example1 - all is in single macro or function:

Code:
Copy      Help
str s
int i
for i 1 11
,s.from("Text" i)
,key (s)
,'Y
,'Sresponse


Example2 - most of the code is in function Func125, but for is in macro:

Macro:
Code:
Copy      Help
int i
for i 1 11
,Func125 i

Function Func125:
Code:
Copy      Help
function i
spe -1
str s
s.from("Text" i)
key (s)
'Y
'Sresponse
#7
Thanks again works perfectly, Smile

Sorry for all the questions. :oops:

Guess I am a slow learner.


Forum Jump:


Users browsing this thread: 1 Guest(s)