Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WaitWindow

Status
Not open for further replies.

kellan4459

IS-IT--Management
Jul 3, 2003
84
US
I am trying to get a better understanding of how WaitWindow uses a string. I have several WaitWindow calls that are working properly but then one doesn't work. The only thing that looks different is it has a dash (-) in it. I have tried escaping the dash with a backslash (\) and several other string manipulations but nothing seems to work.
I define the strings
$SL = "FLAR Login";
$TE = "LAR Explorer";
$TN = "Query By LAR Num";
$TI = "LAR - Information";


then I have a call for each in the code

die "could not open FLAR" unless WaitWindow($SL, 15);

the code continues until I get to the $TI attempt of the die/unless lines. I have tried removing all but LAR from the $TI and it still will not match it. I got the Window name using Spy++.

I have tried looking at the documentation to see how the WaitWindow uses the passed string but I was unsuccessful. Anyone experienced with the use of WaitWindow?
 
WaitWindow is a function of what?

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
WaitWindow($wndtitle,[$wait])

Minimal version of WaitWindowLike. Only requires the window title regexp. You can also specify the wait timeout in seconds.

wndtitle - Regexp for the window title

wait - How many seconds should we wait before giving up
according to the documentation it's not a string but a regular expression, could that be what's causing the issue

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
the way the source for the sub FindWindowLike (which is called by WaitWindowLike which is called by WaitWindow) is written it looks as if PERL should handle it if the string exists.

if ((!$windowre || $sWindowText =~ /$windowre/)

This is the check it does. So I am thinking that if $windowre which is the regex I referred to as a string above. It should check each parent and child windows for that regex/substring. So even if my regex is a string if the window contains that string it should resolve to true and push the window onto the array if I'm understanding the /$regex/ correctly.
 
Alright so for anyone who wants to know. I copied the source from WIN32::GUITEST for the subs FindWindowLike, WaitWindow, and WaitWindowLike and put them in my code with new names. I then had my code call the local subs instead of the WIN32::GUITest packaged versions and Now the string "LAR - Information matches as a substring as I was expecting it to do. Still not sure why the other didn't work the same but I'm not going to spend too much time trying to figure it out.

thanks for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top