Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if statements
#1
How would I make my macro return to a certain line(the top) or close all windows and restart macro if a window was not active/workoffline page and then continue on if it comes up...


i know it' would be something like...

ifa act continue on
ifa- then goto line....

any help?
thanks!
Ashton
#2
Something like this?

Code:
Copy      Help
;top
if(IsWindowVisible(win("window name")))
,goto top
#3

If you're wanting if statement to work with active window, use ifa.

Macro ( Macro92 )
Code:
Copy      Help
;top
ifa "Notepad" ;;If Notepad is active
,out "Notepad is active."
else
,goto top

For more help you should refer back to the QM Reference and search for "ifa".
Taking on Quick Macros one day at a time
#4
Thanks! but how would i get it to goto a certain line in the script rather than just to the top?
#5
top is a label in the example to make it go to a specific line right about the line create a label then use a goto statement and use label u created
Code:
Copy      Help
;top        <-----this is a label
ifa "Notepad" ;;If Notepad is active
,out "Notepad is active."
else
,goto next  ;;<----this is how u make it skip to the label
;some code..
;more code..
;next            <-------this is also label
Code:
Copy      Help
;this is how code should look in qm
;top        

ifa "Notepad" ;;If Notepad is active
,out "Notepad is active."
else
,goto next  
;some code..
;more code..
;next            

out "Notepad is not active"
;to paste into qm copy here and use paste escaped(it can be found either in the edit menu  under other formats or by right clicking the code area  in qm)


Forum Jump:


Users browsing this thread: 1 Guest(s)