Using GetText |
Top Previous Next |
The GetText method is the simplest way to read data from the screen buffer.
VB.NET [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])
C# [string =] tnxxxx.GetText (int StartPos, [int StartPos], [bool Attr = False], [bool Eab = False]); [string =] tnxxxx.GetText (int Row, in Col, int Len, [bool Attr = False], [bool Eab = 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.
VB.NET: Private Sub tn3270_OnScreenChange(eventSender As object, eventArgs As System.EventArgs) ' this code gets the Text from position 150 Dim s As String = tn3270.GetText(150) ... ' this code gets the Text from position 150 to 200 Dim s As String = tn3270.GetText(150,200) ... ' this code gets the Text from row 15 column 4 with a lenght of 20 Dim s As String = tn3270.GetText(15,4,20) End Sub
C#: private void tn3270_OnScreenChange(object eventSender, System.EventArgs eventArgs) { // this code gets the Text from position 150 string s = tn3270.GetText(150); ... // this code gets the Text from position 150 to 200 string s = tn3270.GetText(150,200); ... // this code gets the Text from row 15 column 4 with a lenght of 20 string s = tn3270.GetText(15,4,20); }
|