Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
running a macro/function at same time
#1
is there a way of running 2 function in 2 windows or 2 functions in 1 window
and how?
ty Big Grin
#2

Functions, unlike macros, can run at the same time. Just assign specific window names in each function.
Taking on Quick Macros one day at a time
#3
Question 1- Is it posible to activate or ishue an on order for 2 or more functions from within a macro they are part of or not part of, and make them run in a loop (doing something) while rest of the macro progresses and at some point down the line in the macro isues an order for them to stop execution?

Question 2- if question 1 is positive, and for example i have 3-4 functions running at the same time doing various checks on the sreen. If function ( for example No3), finds something it needs to react to. For it to give the order for restof the functions to pause while it does what it needs to do, and when done to give the order for the rest to continue where they were at the time of the pause order?

Thank's for your help, and if i need to clarify a thing or two just tell.
#4
Yes, yes.
Is the main macro a dialog?
#5
Macro thread_master
Code:
Copy      Help
;start 3 threads
mac("thread_slave")
mac("thread_slave")
mac("thread_slave")

mes "The main macro is running.[][]To test other threads, run or activate Notepad.[][]Click OK to end all." ;;show message box; it waits until you close

;end all threads
shutdown -6 0 "thread_slave"

Function thread_slave
Code:
Copy      Help
rep
,out F"loop: thread {GetCurrentThreadId}"
,0.5
,
,lock ;;prevents executing code between lock and lock- by multiple threads simultaneously. Other threads will be paused.
,
,ifa "Notepad" ;;if Notepad window active
,,mes F"thread {GetCurrentThreadId} is doing something"
,,
,lock-
#6
Awesome&Awesome!!! I can't wait to get this code to use! Big Grin Big Grin Big Grin
-Thank's a lot Gint!


Forum Jump:


Users browsing this thread: 2 Guest(s)