Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Int collab help.
#1
Hello QM Forum,

I got bored the other night and started messing around with a macro just playing around with str,int,..etc and was curious to why this would not work.

Code that works:

double LongWait = 30;;Wait Control
wait LongWait WC "Notepad"
out "Notepad Open"

Then I tried to make the Notepad window into an int and this code didnt work.

int NotePad = win("Notepad")
double LongWait = 30;;Wait Control
wait LongWait WC Notepad
out "Notepad Open"

Im not really sure why it wont work? I know I could just make Notepad a str and call it like,

str Notepad = "Notepad"
wait LongWait WC Notepad

But is there a way I can use the int way? Thanks for your time.
#2
The variable is just simple number, probably 0, and it does not change while waiting.

You can use

wait LongWait WC win("Notepad")

WAIT repeatedly searches for the specified window. It stops when finds the window.
If you use a string value (constant string or str variable), WAIT assumes that it is window name, and searches for a window with the name.
If you use an int value, WAIT assumes that it is some expression that returns window handle. If it is a function (eg win("Notepad")), WAIT repeatedly calls the function until it returns nonzero. But if it is a variable, and it never changes, WAIT never ends.
#3
ok thank you very much, I understand now.


Forum Jump:


Users browsing this thread: 1 Guest(s)