String Property

Description

The entire text plane of the selected object as a string.
 

Applies To Objects

Screen, Field, OIA
 

Syntax

object.String

Element
Description
object
One of the above listed objects.
 

Return Values

Each object returns the following values:

Object
Returned Value
Screen
The entire text plane of the virtual screen as a string. All null characters and Field Attribute characters are returned as blank space characters. Read Only.
Field
The text plane data for the field. This is similar to the GetData method using the OHIO_PLANE_TEXT parameter, except the data is returned as a string instead of a character array. When setting the String property, if the string is shorter than the length of the field, the rest of the field is cleared. If the string is longer than the field, the text is truncated. A subsequent call to this property will not reflect the changed text. To see the changed text, you must call the Refresh method of the Fields object and retrieve a new Field object. Read Only.
OIA
The OIA line as a string. All null characters are returned as blank space characters. The leftmost columns of the OIA status line provide information about the type of connection for the current session. One of the following symbols will appear:
Symbol
Connection Mode
Tn
Basic TN3270 or TN5250 mode.
Te
Enhanced TN3270 or TN5250 mode.
NVT
Network Virtual Terminal (telnet).
 
If you have connected with either a TN3270 or TN3270E connection, another symbol will appear (in column 3, next to Tn or Te), indicating one of the following session states:
Symbol
Hex Value
Session State

7F
LU-LU state (full session).

A5
SSCP-LU state (half session).

3F
Neither LU-LU or SSCP-LU (unowned session).
The current state of the system is indicated by several symbols that appear to the right of the session state (column 8), providing information about the host status. User input is prohibited in each of the following states:
Symbol
String
System State
X
X
Host processing request.
X SYSTEM
X SYSTEM
AID key sending information to the host.
X
X ()
Host transmitting data to the terminal.
X
X - -
Input attempted in protected field (use RESET to release).

 

 

Sample VB Code

Property Cursor, OIA, Fields, Rows, Columns, String

Public AllSessions As OhioSessions
Public WithEvents MySession As OhioSession
Public MyScreen As OhioScreen

Private Sub Form_Load()

Set AllSessions = New OhioSessions
Set MySession = AllSessions.AddSession("C:\test.zcc", 1)
Set MyScreen = MySession.Screen

MySession.Connect

End Sub

Private Sub MySession_OnOIAChanged()

If (MyScreen.OIA.Owner = OHIO_OWNER_APP) Then

MsgBox "Cursor = " & MyScreen.Cursor & vbNewLine & _

"Rows = " & MyScreen.Rows & vbNewLine & _
"Columns = " & MyScreen.Columns & vbNewLine & _
"# of Fields = " & MyScreen.Fields.Count & vbNewLine & _
"String = " & MyScreen.String

End If

End Sub

Private Sub Form_Unload(Cancel As Integer)

MySession.Disconnect
AllSessions.CloseSession MySession.SessionName

End Sub

Sample C++ Code

BEGIN_DISPATCH_MAP(CMyView, CView)

DISP_FUNCTION_ID(CMyView, "OnScreenChanged",  1, OnScreenChanged,  VT_EMPTY, VTS_I4 VTS_I4 VTS_I4)

END_DISPATCH_MAP()

void CVCSampleView::OnScreenChanged(long iUpdate, long iStart, long iEnd)
{

IOhioFields AllFields = m_MyScreen.GetFields();
IOhioOIA MyOIA = m_MyScreen.GetOia();

TRACE( "Cursor = %d\n"

"Rows = %d\n"
"Columns = %d\n"
"# of Fields = %d\n"
"First Row = %s\n"
"OIA Owner = %d\n",
m_MyScreen.GetCursor(),
m_MyScreen.GetRows(),
m_MyScreen.GetColumns(),
AllFields.GetCount(),
m_MyScreen.GetString().Left(m_MyScreen.GetColumns()),
MyOIA.GetOwner() );

}

Sample C# Code for Screen.String

try

{

PASSHIOLib.IOhioFields AllFields = screen.Fields;

PASSHIOLib.IOhioOIA MyOIA = screen.OIA;

MessageBox.Show(

"Cursor = " + screen.Cursor +

"\nRows = " + screen.Rows +

"\nColumns = " + screen.Columns +

"\n# of Fields = " + AllFields.Count +

"\nFirst Row = " + screen.String.Substring (0, screen.Columns) +

"\nOIA Owner = " + MyOIA.Owner);

}

catch (Exception ex)

{

MessageBox.Show ("Exception: " + ex);

}

Sample C# Code for Field.String

try

{

PASSHIOLib.IOhioFields AllFields = screen.Fields;

PASSHIOLib.IOhioField MyField = AllFields[1];

System.Array aData = (System.Array)MyField.GetData (PASSHIOLib.OHIO_PLANE.OHIO_PLANE_TEXT);

String strFieldData = "";

for (int i = 0; i < aData.Length; i++)

strFieldData += Convert.ToChar (aData.GetValue (i));

MessageBox.Show ("First Field" +

"\n   Start = " + MyField.Start +

"\n   End = " + MyField.End +

"\n   Length = " + MyField.Length +

"\n   Protected = " + MyField.Protected +

"\n   Hidden = " + MyField.Hidden +

"\n   Modified = " + MyField.Modified +

"\n   Numeric = " + MyField.Numeric +

"\n   Attribute = " + MyField.Attribute +

"\n   High Intensity = " + MyField.HighIntensity +

"\n   PenSelectable = " + MyField.PenSelectable +

"\n   String = " + MyField.String +

"\n   GetData = " + strFieldData);

}

catch (Exception ex)

{

MessageBox.Show ("Exception: " + ex);

}

Sample C# Code for OIA.String

try

{

PASSHIOLib.IOhioOIA MyOIA = screen.OIA;

String strStatus, strOwner;

switch (MyOIA.InputInhibited)

{

case PASSHIOLib.OHIO_INPUTINHIBITED.OHIO_INPUTINHIBITED_NOTINHIBITED:

strStatus = "NOTINHIBITED";

break;

case PASSHIOLib.OHIO_INPUTINHIBITED.OHIO_INPUTINHIBITED_OTHER:

strStatus = "OTHER";

break;

case PASSHIOLib.OHIO_INPUTINHIBITED.OHIO_INPUTINHIBITED_SYSTEM_WAIT:

strStatus = "SYSTEM_WAIT";

break;

default:

strStatus = "Error";

break;

}

switch (MyOIA.Owner)

{

case PASSHIOLib.OHIO_OWNER.OHIO_OWNER_APP:

strOwner = "APP";

break;

case PASSHIOLib.OHIO_OWNER.OHIO_OWNER_NVT:

strOwner = "NVT";

break;

case PASSHIOLib.OHIO_OWNER.OHIO_OWNER_SSCP:

strOwner = "SSCP";

break;

case PASSHIOLib.OHIO_OWNER.OHIO_OWNER_UNKNOWN:

strOwner = "UNKNOWN";

break;

case PASSHIOLib.OHIO_OWNER.OHIO_OWNER_UNOWNED:

strOwner = "UNOWNED";

break;

default:

strOwner = "Error";

break;

}

MessageBox.Show ( "InputInhibited = " + strStatus +

"\nOwner = " + strOwner +

"\nAlphanumeric = " + MyOIA.Alphanumeric +

"\nNumeric = " + MyOIA.Numeric +

"\nString = " + MyOIA.String );

}

catch (Exception ex)

{

MessageBox.Show ("Exception: " + ex);

}