How do i guest a macro- to call out a userdefined function only at specific times. What i mean is If i wanted to have a macro do a specific task like check email or something, and have it open a notepad every 3 minutes , how do i get it to run the macro, but only have the function timed at 3 minutes to open a notepad, but keep the other task of the macros running constantly?
Posts: 12,061
Threads: 140
Joined: Dec 2002
Example:
Macro
atend endfunc88
mac "func88"
10
Function func88
int i
for i 0 1000000000
,out i
,1
Function endfunc88
Explanation:
At the beginning of the macro, it registers function endfunc88 to run when the macro ends. Then launches function func88, which runs independently from the macro. In this example, the function displays i every 1 second, but real function can contain any code, for example run notepad every 3 minutes. When the macro ends (naturally, or when you press Pause), runs function endfunc88 ands ends function func88. In this example, the macro just waits 10 seconds, but real macro can do anything.
You asked how to call the function (in this case - func88) at specific times. Instead, here it runs constantly, and uses for or rep to execute some code at specific times (in this case - every 1 second).
At first, experiment with this example to see how it works. Create a macro and two functions (func88 and endfunc88) and paste the code. Then run the macro. Is it what you need?