Using GetText

Top  Previous  Next

The GetText method is the simplest way to read data from the screen buffer.

 

VB

[String =] tnxxxx.GetText (StartPos As Integer, [EndPos As Integer], [Attr As Boolean = False], [Eab As Boolean = False])

[String =] tnxxxx.GetText (Row As Integer, Col As Integer, Len as Integer, [Attr As Boolean = False], [Eab As Boolean = False])

 

Delphi

[String :=] tnxxxx.GetText (StartPos : Integer, [EndPos : Integer], [Attr : Boolean = False], [Eab : Boolean = False])

[String :=] tnxxxx.GetText (Row : Integer, Col : Integer, Len : Integer, [Attr : Boolean = False], [Eab : Boolean = False])

 

Start position and the end position of the text buffer to retrieve can be set using StartPos and EndPos parameters or Row,Col and Len parameters.

 

Examples:

 

 VB:

 Private Sub telnet_OnScreenChange()

        ' this code gets the Text from position 150

    Dim s As String = telnet.GetText(150)

         ...

        ' this code gets the Text from position 150 to 200

    Dim s As String = telnet.GetText(150,200)

         ...

        ' this code gets the Text from row 15 column 4 with a lenght of 20

    Dim s As String = telnet.GetText(15,4,20)

 End Sub

 

 Delphi:

 procedure TForm1.Tnb3270E1ScreenChange(Sender: TObject);

 var s:string;

 begin

        // this code gets the Text from position 150

    s := Tnb3270E1.GetText(150);

         ...

        // this code gets the Text from position 150 to 200

    s := Tnb3270E1.GetText(150,200);

         ...

        // this code gets the Text from row 15 column 4 with a lenght of 20

    s := Tnb3270E1.GetText(15,4,20);

 end;