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

WaitForString Method 1

Status
Not open for further replies.

vzachin

Technical User
Feb 10, 2006
305
US
i have a problem getting the waitforstring method to work when i specify column only.

i have an * that may or maynot appear in column 2.

i am using the following coding:

M1=Sess0.Screen.WaitForString ("*", ,2)
If M1 Then
Sess0.Screen.putstring "1",20,1
End If

this does not recognize the * in column 2

i have also tried M1=Sess0.Screen.WaitForString ("*",[col 2]) as well but this will find * anywhere on the screen.

is there another method i can use? what am i doing wrong?

thanks
vzac
 
Are waiting for the "*" to paint to screen object (as in that's how you know when the page is loaded), or are you just looking for all "*" on the page after it's painted?

Could the're be "*"'s on more than one row in col 2?

This will check all rows col 2 for an "*" but the page has to be loaded as it isn't waiting for anything.
Code:
for Row = 1 to Sess0.Screen.Rows
    If Sess0.Screen.GetString(row, 2, 1) = "*" then 
        GotAss = True
        Exit For
    End If
next

If GotAss then Sess0.Screen.putstring "1",20,1

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Thanks MrWilson for the coding. That works!

There could be more than one "*" in column 2.
Is it possible to put a "1" in the same row as the corresponding "*" in column 8 for each occurance of "*"?

For example:
i have an "*" in ROW19, COL2, and ROW21,COL2.
i want to put a "1" in ROW19, COL8, and ROW19,COL8.

thanks again
vzac

 
for Row = 1 to Sess0.Screen.Rows
If Sess0.Screen.GetString(row, 2, 1) = "*" then Sess0.Screen.putstring "1",row,1
next


[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
OOPS you said column 8


for Row = 1 to Sess0.Screen.Rows
If Sess0.Screen.GetString(row, 2, 1) = "*" then Sess0.Screen.putstring "1",row,8
next


[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
I assumed you meant

i have an "*" in ROW19, COL2, and ROW21,COL2.
i want to put a "1" in ROW19, COL8, and ROW21,COL8.


[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
MrMilson,

Thanks for your reply & coding. It works.
btw, sorry i mispelled your name.
 

Glad you liked it Skie[bigsmile]

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top