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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable question 1

Status
Not open for further replies.

dvirgint

Programmer
Jun 28, 2010
85
0
0
CA
Hello all,

I'm a beginner in programming and have been working on some macros at work. I have run into a problem with a variable. My question is this:

Can I have a variable in a "WaitForString" statement?

ex. - Sess0.Screen.WaitForString("nameofvariable MONTH DAY")

Sorry for the lack of knowledge on my part.

Thanks for any responses.
 



hi,

WaitFor... methods are used as a means of waiting for an asynchronous screen response, which is decoupled from the VB code excution.

So, I you have 1) sent a key and 2) have to wait for a string, and 3) that string at that position is the ONLY string that will appear when the screen responds, then yes.

However, it must be in a LOOP, because your code execution and the screen response are not directly related...
Code:
  do
    if Sess0.Screen.WaitForString(YourVariable & MONTH & DAY, r, c) then exit do
    DoEvents
  loop
where r & c are the row and column where you expect the string to begin, and your variable MONTH and DAY are concatenated in to one string what is the string you expect at r,c.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top