03-12-2009, 07:35 AM
Hi, I have a code that will repeat itself & keep getting the "str+ hwnd2" variable, which is recieved from an ACC Event Trigger which gets the text of a certain Item. What I have is this:
Trigger that recieves the text:
$a 140 0 0 "Button" 10024 "" "#32770" "";;this works fine to recieve the text I need.
Code inside that triggered function:
str+ hwnd2.getwintext(id(10024));;gets the text I want when function is triggered, & sets it to a global variable so i can use it in my rep loop whilst updating every repeat over the code in the macro below;; "Note , the text keeps changing every so often, so that's why it needs updated in the rep loop"
Code that i am having problems with:
rep
,str+ hwnd2
,goto g1
, g1
,_s.getwintext(id(10024 handleofparent))
,if(_s=hwnd2);; if _s=the updated global variable... then check again (this should tell if it changes) "Note , this is working fine"
,,goto g1
,else goto g2
, g2
,but+ id(10024 handleofparent);; HERE LIES MY PROBLEM, I WANT IT TO START COUNTING UNTIL IT REACHES 5 TIMES THAT THE GLOBAL VARIABLE HAS ,CHANGED, WHILST CHECKING THE GLOBAL VARIABLE, SOMETHING LIKE THE FOLLOWING:
,rep
,,str+ hwnd2
,,_s.getwintext(id(10024 handleofparent))
,,if(_s=hwnd2)
,,,RIGHT HERE I WANT IT TO START COUNT AT 1, THEN COUNT UP TO 5 THEN DO THE FOLLOWING WHEN COUNT REACHES 5 TIMES THAT THE GLOBAL ,,,VARIABLE HAS ,,,CHANGED/BEEN TRIGGERED:
Trigger that recieves the text:
$a 140 0 0 "Button" 10024 "" "#32770" "";;this works fine to recieve the text I need.
Code inside that triggered function:
str+ hwnd2.getwintext(id(10024));;gets the text I want when function is triggered, & sets it to a global variable so i can use it in my rep loop whilst updating every repeat over the code in the macro below;; "Note , the text keeps changing every so often, so that's why it needs updated in the rep loop"
Code that i am having problems with:
rep
,str+ hwnd2
,goto g1
, g1
,_s.getwintext(id(10024 handleofparent))
,if(_s=hwnd2);; if _s=the updated global variable... then check again (this should tell if it changes) "Note , this is working fine"
,,goto g1
,else goto g2
, g2
,but+ id(10024 handleofparent);; HERE LIES MY PROBLEM, I WANT IT TO START COUNTING UNTIL IT REACHES 5 TIMES THAT THE GLOBAL VARIABLE HAS ,CHANGED, WHILST CHECKING THE GLOBAL VARIABLE, SOMETHING LIKE THE FOLLOWING:
,rep
,,str+ hwnd2
,,_s.getwintext(id(10024 handleofparent))
,,if(_s=hwnd2)
,,,RIGHT HERE I WANT IT TO START COUNT AT 1, THEN COUNT UP TO 5 THEN DO THE FOLLOWING WHEN COUNT REACHES 5 TIMES THAT THE GLOBAL ,,,VARIABLE HAS ,,,CHANGED/BEEN TRIGGERED: