ikodan Posted October 21, 2015 Report Share Posted October 21, 2015 Hello, I have this script : <IF WINDOW Option="\x00" Title="%persos[1]%" Partial="FALSE" Wildcards="FALSE"/> <REPEAT UNTIL Variable="%active_window%" Condition="\x00" Value="%perso[2]%"/> <VARIABLE SET STRING Option="\x05" Destination="%active_window%"/> <WINDOW ACTIVATE Title="%persos[2]%" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/> <END REPEAT/> <ELSE/> If I debug, the first loop, %active_window% <> %perso[2]% the second loop, %active_window% == %perso[2]% But the "repeat until" don't stop ! I do not see where I could make a mistake. (for information, if I use this method, it is because the "<WAIT FOR WINDOW TITLE Title="%persos[2]%" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>" bugs with a succession of 8 windows and small delays between, like 100ms). Quote Link to comment Share on other sites More sharing options...
Cory Posted October 21, 2015 Report Share Posted October 21, 2015 I don't have time to consider this closely so I don't know if this helps but I think you misspelled a variable. Window Activate Title uses "persos" and the repeat control is "perso". On another note you really shouldn't ever use repeat this way. It's better to use two macros with activation. Also I consider it a bad practice to have a loop like this. It could process a million times a second and bog your CPU and make other apps unresponsive. It's better to put a small delay in. EG 100mS so it only iterates 10 times a second. Usually that's plenty. Finally I never make loops that have the risk of infinite recursion. In this case I'd make it a loop of finite number which results in a tolerable wait period. For instance if I believe it should never take more than 10 seconds and I'm having it delay 100mS each iteration then I'd loop 100 times. If it finished and never got a hit, controlled by a Boolean variable I'd display an error message to the user. Quote Link to comment Share on other sites More sharing options...
ikodan Posted October 21, 2015 Author Report Share Posted October 21, 2015 Omg it's true, I don't saw it ! Yes for the delay, I done it for the same raisons. For the infinite loop, it's wanted because the macro must do it. No problem, sorry for the variable, I re-read 15 times without seeing it. Quote Link to comment Share on other sites More sharing options...
rberq Posted October 21, 2015 Report Share Posted October 21, 2015 No problem, sorry for the variable, I re-read 15 times without seeing it. Don't feel bad. I once spent two days re-reading four little lines of IBM Assembler code before I finally saw my error. Once you "know" what it says, your brain automatically plugs that in for you to save time. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 26, 2015 Report Share Posted October 26, 2015 Sometimes I read things backwards to find errors. Especially proof reading things. One's brain expects to see things and is quick to accept the shape of a word more than the exact spelling. Quote Link to comment Share on other sites More sharing options...
amonaghan Posted October 27, 2015 Report Share Posted October 27, 2015 Slightly off topic, but just to prove the point about proof reading:- Olny srmat poelpe can raed this. I cdnuolt blveiee that I cluod aulaclty uesdnatnrd what I was rdanieg. The phaonmneal pweor of the hmuan mnid, aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in what oredr the ltteers in a word are, the olny iprmoatnt tihng is that the first and last ltteer be in the rgh it pclae. The rset can be a taotl mses and you can still raed it wouthit a porbelm. This is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the word as a wlohe. Amzanig huh? Yaeh and I awlyas tghuhot slpeling was ipmorantt! If you can raed this psas it on !! Quote Link to comment Share on other sites More sharing options...
amonaghan Posted October 27, 2015 Report Share Posted October 27, 2015 I have an alphanumeric one too which will blow the mind. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 27, 2015 Report Share Posted October 27, 2015 That rocks. I wonder if anyone has written a converter to do this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.