Posts: 1,336
Threads: 61
Joined: Jul 2006
i'm trying 2 make a counter so that evry so often it calls a function
it will be inside of a function that is called when the main macro ends calls a function which inturn calls another function,which inturns calls another function.
what i'm tring 2 do is every so often instead of calling the 3rd function call a different function and reset the counter
i tried using this
but it just seems 2 skip over it
int x
x+1
if x= 200
,,"Function5"
,,x=0
else
,Function3
[/code]
also tried if x<12
also tried using Function5 without quotes
can u help?[/code]
Posts: 1,336
Threads: 61
Joined: Jul 2006
int x
x+1
if x= 12
,,"Function5"
,,x=0
else
,Function3
Posts: 1,769
Threads: 410
Joined: Feb 2003
you forgot the rep command.
http://www.quickmacros.com/help/Flow/IDP_REP.html
use it like this
rep ####
,statement
,statement
Posts: 1,336
Threads: 61
Joined: Jul 2006
i don't want the whole function 2 repeat just the counter 2 work
Posts: 1,336
Threads: 61
Joined: Jul 2006
what i need it 2 do and ,maybe a counter is the wrong way 2 go is every lets say 12th time this function is called go2 another function instead rep doesn't work it just repeats the function over and and over.these functions are not part of the main macro.they are called after the macro ends using atend
ex
main macro
statements...
....
.....
atend function 1
then after function 1 finishes it calls function 2 when function 2 finishes it calls function 3
but every 12 th time i want 2 call function 5 instead of function3.these function do not repeat there are onlt called after the main macro ends?
Posts: 1,769
Threads: 410
Joined: Feb 2003
try something like this; you'll need to change some things.
int x
rep 100
,x+1
,out x
,if x=12
,,bee
,,1
,,x=0
,else
,,Function3
[/code]
Posts: 1,336
Threads: 61
Joined: Jul 2006
hey ty for your help but it is still making the function repeat.Is there a way 2 set up a counter without using rep or for?
Posts: 1,769
Threads: 410
Joined: Feb 2003
post your other function codes; sounds like they are ending so quickly that it seems like it's not waiting.
Posts: 1,336
Threads: 61
Joined: Jul 2006
ok this is what it is doing.It is displaying # in output excuting function,then next function,then going back 2 main macro like it is supposed 2.macro starts then 4 some reason the function with the counter is stopping the macro and repeating
and will keep going on like this till i exit qm.the 2 functions after the counter execute in about 7 seconds.But like i said is there a way 2 create a counter without using rep or for?
Posts: 1,271
Threads: 399
Joined: Mar 2003
kevin, it would be really helpful when you provide your code.
right click in editor -> other formats -> copy bbcode
and paste here.
Posts: 1,336
Threads: 61
Joined: Jul 2006
sorry i didn't post a replay because i used a global variable and it works perfectly
basically like this
int+ x
some statements
x+1
if x=12
function3
x=0
else
more statements