INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

getstring not working

getstring not working

(OP)
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

RE: getstring not working

Hi,

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

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: getstring not working

(OP)
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


on this screen you can see that what was shown by MSGBox is on previous screen

RE: getstring not working

Plx post your code.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: getstring not working

(OP)

CODE --> VBA

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 

RE: getstring not working

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(31,1,15) 

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close