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!

getstring not working

Status
Not open for further replies.

buko88

Programmer
Jul 20, 2016
8
0
0
GB
Hi Guys,

I have issue when I want to get to the last row on last page in attachmate extra. I can see that last character is on page 2, line 13. When i do MsgBox Sess0.screen.getstring(13,1,60) it will output correct characters.
But when I use 14th line :MsgBox Sess0.screen.getstring(14,1,60) I will get result which is actually on the previous page on that line.

Is there anything i can do to get only characters that are visible on current page?

PS: MsgBox is the only code that I have in macro

Thanks
 
Hi,

All your emulator "sees" is what's on the screen. You are scraping characters off the data displayed in front of you.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
On the first picture you can see that i`m on page 2 and
MsgBox (Sess0.screen.getstring(15,1,15) will output something that is not there
extra_ph6srh.png


on this screen you can see that what was shown by MSGBox is on previous screen
extra1_mlhi2l.png
 
Plx post your code.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Code:
Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
    Dim Sessions As Object
    Dim System As Object
    Dim Host As Object
    Set System = CreateObject("EXTRA.System")    ' Gets the system object
    If (System is Nothing) Then
        Msgbox "Could not create the EXTRA System object.  Stopping macro playback."
        STOP
    End If
    Set Sessions = System.Sessions
 
    If (Sessions is Nothing) Then
        Msgbox "Could not create the Sessions collection object.  Stopping macro playback."
        STOP
    End If
'--------------------------------------------------------------------------------
' Set the default wait timeout value
    g_HostSettleTime = 3000        ' milliseconds
 
    OldSystemTimeout& = System.TimeoutValue
    If (g_HostSettleTime > OldSystemTimeout) Then
        System.TimeoutValue = g_HostSettleTime
    End If
 
' Get the necessary Session Object
    Dim Sess0 As Object
    Set Sess0 = System.ActiveSession
    If (Sess0 is Nothing) Then
        Msgbox "Could not create the Session object.  Stopping macro playback."
        STOP
    End If
    If Not Sess0.Visible Then Sess0.Visible = TRUE
    Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
    
'--------------------------------------------------------------------------------

        
        
MsgBox  Sess0.screen.getstring(1,76,1)   
MsgBox  Sess0.screen.getstring(15,1,15)  


 

End Sub
 
What happens if you add to 15 the number of rows on a screen. So if your screen if 16 rows...
Code:
MsgBox  Sess0.screen.getstring([b]31[/b],1,15)

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