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

Recognizing top or end of scrollable data

Status
Not open for further replies.

jonnavarra

Programmer
Mar 18, 2008
3
US
Is there a way to recognize that the screen is at the limit eitherway after SENDKEYS <Pf8> or <Pf7>?

I want my macro to scroll up/down till the end. I have no unique identifiers/literals to tell me I've reached the top or bottom. Is there anything in the OIA status to tell me? Any solution will do, if any. thanks
 
There are two rooms. In the first, there are three switches. In the second - there are three light bulbs. The door between them is closed. You are only allowed to go into the second room once.
If you start in the first room, how do you find out which switch operates which bulb?

I guess if there was absolutely *nothing* there, you could look for the complete opposite --- just make an area-object somewhere (perhaps even the whole page) that looks for change NOT happening .

Code:
'Assumes the session was already declared...
' using "my_screen" to shorten the name
        Set My_screen = Sess0.Screen  
'----------------------------------------------------
        Dim scan_screen As Object
        Set scan_screen = my_screen.Area(1,1,24,80)
        Dim old_screen As String
        old_screen = my_screen

        my_screen.SendKeys("<pf6>")
        
        Do while my_screen.OIA.XStatus = 5        
        Sess0.WaitForTimer 50        
        Loop 
        Sess0.WaitForTimer 200  
        
        if scan_screen = old_screen then
        MsgBox "End of page reached",0,"Warning:"
        Stop
        End If

....of course, ignore this is someone else posts a way to return "last page reached"
 
Thankx, thats basically what I ended up doing... best I can do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top