Rustywinger Posted August 24, 2007 Report Share Posted August 24, 2007 I have a macro with an argument that checks if the control text in C5 is visible. This is meant to close any dialog boxes that might pop up in the course of forcing this dog of a data entry application to speed things up, but the amount of dialog boxes varies from record to record. I notice there are no "C" variables in the "Repeat until" command in the scripting editor... is there a way to edit it in the direct editor to look to see if the C5 control is visible before exiting the loop? Right now I just have an argument copied over 8 times to cover the maximum amount of dialog boxes that might appear, but its a little too crude for my picky sensibilities. Thanks! /3 posts in two days... boy, I must seem very lazy! :-\ Quote Link to comment Share on other sites More sharing options...
Cory Posted August 24, 2007 Report Share Posted August 24, 2007 In cases like these I create an infinite loop and use other means to control the egress. At the end of the loop I owuld create an "If C5 Visible" conditon and inside that If-Endif section put a Break command. Quote Link to comment Share on other sites More sharing options...
Rustywinger Posted August 27, 2007 Author Report Share Posted August 27, 2007 Hi, Cory! Thanks for the suggestion, I actually got down and fixed this about 5 mintues after posting... not so lazy after all! Here is my crude, yet simple solution which I put in a macro without activation and then ran it from within other Macros as an "applet": Repeat Until %T39% = "8" If Not Control %C1% Visible Repeat Exit End If Delay 50 Milliseconds Repeat End The "8" means nothing of course... the real condition that is being sought is "If Not Control %C1% Visible". So the macro happily loops and loops until the network lag finally clears the closed window allows the remaining code to continute unmolested. Quote Link to comment Share on other sites More sharing options...
cyberchief Posted August 27, 2007 Report Share Posted August 27, 2007 Rustywinger, Just a small suggestion... because I, like you, like order in my macros... Rather than using Repeat Until %T39% = "8" for infinite loops, I use "Repeat Until %T1% <> %T1%"... basically, repeat until T1 does not equal T1... since T1 will always = T1... it will keep going until another set of requirements have been met. Just a suggestion to keep it clean. I use this quite frequently. And you will never have to worry about using up a variable. Quote Link to comment Share on other sites More sharing options...
Cory Posted August 27, 2007 Report Share Posted August 27, 2007 As long as we're bing tidy you might want to use Break instead of Repeat Exit. It works in all types of repeats and I think Repeat Exit is just there for reverse compatibility. Quote Link to comment Share on other sites More sharing options...
Rustywinger Posted August 28, 2007 Author Report Share Posted August 28, 2007 CC- Your suggestion actually hurt my head since I'd been out last night celebrating my cleverness. I like how you have the computer debate whether the chicken or the egg comes first while secretly, the loop is craving for ham. Cory- Duly noted, my code now has a break in there instead. Thanks! :-) 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.