Attachmate Verastream SDK for UMC Reference Guide v4.0

com.attachmate.UPG.common
Interface IScreenUPG

All Superinterfaces:
com.attachmate.UPG.common.IScreen, com.attachmate.UPG.common.IScreenUPGInternal

public interface IScreenUPG
extends com.attachmate.UPG.common.IScreenUPGInternal


Field Summary
static java.lang.String copyright
           
 
Fields inherited from interface com.attachmate.UPG.common.IScreenUPGInternal
BgBlack, BgBlue, BgCyan, BgDarkBlue, BgDarkCyan, BgDarkGray, BgDarkGreen, BgDarkMagenta, BgDarkRed, BgDarkYellow, BgGray, BgGreen, BgMagenta, BgRed, BgWhite, BgYellow, Blink, Bold, Bright, Dim, DoubleHeight, DoubleWidth, evSDKversion, FgBlack, FgBlue, FgCyan, FgDarkBlue, FgDarkCyan, FgDarkGray, FgDarkGreen, FgDarkMagenta, FgDarkRed, FgDarkYellow, FgGray, FgGreen, FgMagenta, FgRed, FgWhite, FgYellow, LeftColSep, MAXWAITIME, Normal, Reverse, SCREEN_3270, SCREEN_5250, SCREEN_ALC, SCREEN_T27, SCREEN_UTS, SCREEN_VT, Secure, Special, StrikeThrough, Top_Bottom, Underscore, Upper
 
Fields inherited from interface com.attachmate.UPG.common.IScreen
ALC_CONFIGDATA, ALC_CONFIGREAD, ALC_ERROR_TRAFFIC_CLASS, ALC_HOSTACTIVE, ALC_HOSTINACTIVE, ALC_HOSTLOST, ALC_MODEM_SIGNALS, ALC_PRINTER_DATA, ALC_STRUCTURED_DATA, ALC_TERMINAL_DATA, AREA_BLOCK, AREA_POINT, AREA_STREAM, ATM_3270_MODEL_2, ATM_3270_MODEL_3, ATM_3270_MODEL_4, ATM_3270_MODEL_5, ATM_3270_MODEL_AUTOSENSE, DIRECTION_BACKWARD, DIRECTION_FORWARD, FIELDTYPE_ANY, FIELDTYPE_PROTECTED, FIELDTYPE_UNPROTECTED, FINDFIELD_CURRENT, FINDFIELD_NEXT, FINDFIELD_PREVIOUS, GETDATA_CONTAINS_DBCS, GETDATA_FMT_HIDDEN, GETDATA_FMT_HLLAPI_ATTR_CGA, GETDATA_FMT_HLLAPI_ATTR_EAB, GETDATA_FMT_HLLAPI_ATTR_EAD, GETDATA_FMT_HLLAPI_ATTR_HOSTEAB, GETDATA_FMT_HLLAPI_FA_SPACE, GETDATA_FMT_INTERLACED, GETDATA_FMT_PASS_NULLS, GETDATA_FMT_TEXT, GETDATA_FMT_VTPRIV_CHARATTR, GETDATA_FMT_VTPRIV_STATUS, GETDATA_FMT_WRAP, GETDATA_FOUND, GETDATA_NOTFOUND, GETDATA_TYPE_HLLAPI, GETDATA_TYPE_VTPRIV, GETSTRING_COMMA, GETSTRING_CR, GETSTRING_CRLF, GETSTRING_NO_FINAL_APPEND, GETSTRING_TAB, GETSTRING_UNWANTED_COMMA, GETSTRING_UNWANTED_SKIP, GETSTRING_VIRTUAL_SKIP, HOST_STATUS, HOST_STATUS_HOSTACTIVE, HOST_STATUS_HOSTINACTIVE, HOST_STATUS_HOSTLOST, KEYTYPE_BRACES, KEYTYPE_HLLAPI, KEYTYPE_IGNORE_INTERCEPT, PUTSTRING_SKIP, PUTSTRING_SPAN, PUTSTRING_STOP, SCREEN_UNKNOWN, SCREENATTR_ANY, SCREENATTR_HIDDEN, SCREENATTR_PROTECTED, SCREENATTR_UNPROTECTED, SCREENATTR_VISIBLE, UPDATE_CLIENT, UPDATE_HOST, UPDATE_REFRESH, UTS_DESELECT, UTS_DEVICESTATUS, UTS_DEVICESTATUS_BUSY, UTS_DEVICESTATUS_ERROR, UTS_DEVICESTATUS_NOTREADY, UTS_DEVICESTATUS_OFFLINE, UTS_DEVICESTATUS_POC, UTS_DEVICESTATUS_READY, UTS_DEVICESTATUS_THRU, UTS_MSGWAIT, UTS_SELECT, WAITFORKEYS_AID, WAITFORKEYS_ALL, WAITFORKEYS_INTERCEPT, WAITFORKEYS_NON_AID, WAITFORKEYS_NOTIFY, WRAP_OFF, WRAP_ON
 
Method Summary
 void addIScreenListener(java.util.EventListener inListener)
          Adds the ScreenListener, which allows your application to receive various screen and/or status event notifications, to the Screen object.
 void clearCapturedData()
          Clears information from the captured data buffer by setting it to null.
 void Close()
          Closes the current host session.
 int fieldCount(int Type)
          Returns the number of fields of the specified type.
 boolean findField(int inRow, int inCol, int inMode, int inType, int inWrap, MutableInt outRow, MutableInt outColumn, MutableInt outLength, MutableInt outAttribute)
          Searches the presentation space for the specified field, beginning from the row and column position specified.
 boolean findFieldEx(int inbeginIndex, int inMode, int inType, int inWrap, MutableInt outRow, MutableInt outCol, MutableInt outLength, MutableInt outAttribute)
          Searches the presentation space for the specified field, beginning from the index (field number) specified.
 boolean findString(java.lang.String inText, int inStartRow, int inStartColumn, MutableInt outRow, MutableInt outColumn)
          Searches the presentation space for the specified text string, starting at the specified position.
 boolean findStringEx(java.lang.String inText, int inStartRow, int inStartColumn, int inEndRow, int inEndColumn, int inArea, int inWrap, int inDir, MutableInt outRow, MutableInt outColumn)
          Searches the presentation space for the specified text string, from the specified start position to the specified end position.
 byte[] getCapturedBytes()
          Returns the currently captured data as a byte array.
 java.lang.String getCapturedData()
          Returns the currently captured data as a String.
 int getColumns()
          Returns the number of columns in the current presentation space.
 void getCursor(MutableInt outRow, MutableInt outColumn)
          Returns the current cursor position.
 int getCursorColumn()
          Returns the column of the current cursor position.
 int getCursorRow()
          Returns the row of the current cursor position.
 boolean getDataCapture()
          Returns the current state of the data capture facility: true if on; false if off.
 java.lang.String getDescription()
          Returns a custom description for the Screen object, if a description was created previously using setDescription.
 java.lang.String getExtPS(int Row, int Col, int PSLength)
          Returns the specified portion of the presentation space in a string format.
 byte[] getExtPSBytes(int Row, int Col, int PSLength)
          Returns the specified portion of the presentation space in a byte array format.
 boolean getgetText_Display()
          Returns the current setting of the getText_Display property.
 boolean getKeyboardLocked()
          Returns the current state of the keyboard: true if locked; false if unlocked.
 java.lang.String getLastError()
          Returns a description of the most recent error that occurred.
 int getMaxDataCaptureLength()
          Returns the current maximum buffer size for data captured using the data capture facility.
 int getObjectVersion()
          Returns the version number of the specified Screen object (4xxxyyy); for example, 3001000 is equivalent to version 3.1.00.
 byte[] getOIAByteContents()
          Returns the data displayed in the OIA portion (status line) of the presentation space.
 java.lang.String getOIAContents()
          Returns the data displayed in the OIA portion (status line) of the presentation space.
 java.lang.String getOIAText()
          Returns the text of the OIA portion (status line) of the presentation space in a string format.
 boolean getOperatorDisable()
          Gets the current Operator Disabled status for MATIP sessions.
 boolean getPeripheralControl()
          Gets the current Peripheral Control State for UTS INT-1 sessions.
 int getRows()
          Returns the number of rows in the presentation space.
 int getScreenType()
          Returns the current host type.
 java.lang.String getString(int inStartRow, int inStartColumn, int inLength)
          Returns the visible text from the specified location.
 java.lang.String getStringEx(int inStartRow, int inStartColumn, int inEndRow, int inEndColumn, int inArea, int inWrap, int inAttr, int inFlags)
          Returns text from the specified location, for attributes matching those specified by inAttr.
 java.lang.String getText()
          Returns the text contents of the presentation space as a string.
 boolean isConnected()
          Returns the state of the Mainframe/Gateway connection: true if connected; false if unconnected.
 boolean isKeyboardLocked()
          Returns the state of the keyboard: true if locked; false if unlocked.
 boolean Open()
          Opens a host session.
 boolean OpenEx(int timeout)
          Opens a host session, waiting a specified time for the connection to be established before returning.
 int putString(java.lang.String inText, int inRow, int inColumn)
          Copies a string of text to the specified position in the presentation space, returning the number of characters written.
 int putStringEx(java.lang.String inText, int inStartRow, int inStartColumn, int inEndRow, int inEndColumn, int inArea, int inWrap, int inModes, boolean inFill)
          Copies a string of text to the specified position in the presentation space, returning the number of characters written.
 int RawDataTransmit(java.lang.String writeBuffer)
          Writes a string of characters directly to the host communications layer, without going through the presentation space.
 int RawDataTransmitBytes(byte[] writeBuffer)
          Writes an array of bytes directly to the host communications layer, without going through the presentation space.
 void removeIScreenListener(java.util.EventListener inListener)
          Removes the ScreenListener from the Screen object.
 void sendKeys(java.lang.String inText, int inType)
          Sends characters and special keys to the session.
 int SendStatus(int type, byte[] detail)
          Sends a status message with option detail to screen.
 void setCursor(int inRow, int inColumn)
          Sets the cursor position on the presentation space.
 void setCursorColumn(int CursorColumn)
          Sets the column of the cursor position.
 void setCursorRow(int CursorRow)
          Sets the row of the cursor position.
 void setDataCapture(boolean sDCVal)
          Turns the data capture facility on or off.
 void setDataCaptureEx(boolean sDCVal, boolean sSPSUVal)
          Turns the data capture facility on or off.
 void setDescription(java.lang.String description)
          Creates a custom description for the Screen object.
 void setgetText_Display(boolean gtdvalue)
          Turns the getText_Display property on or off.
 void setMaxDataCaptureLength(int dcl)
          Sets the maximum buffer size for data captured using the data capture facility.
 void setOperatorDisable(boolean b)
          Attempts to set Operator Disabled status for MATIP sessions.
 void setPeripheralControl(boolean sPerCntrl)
          Sets the Peripheral Control State for UTS INT-1 sessions.
This advanced feature is for applications that want control over print activity.

The "setPeripheralControl" method is called for an application to either establish or relinquish control over peripheral status response generation (i.e.
 void waitForCursor(int inRow, int inColumn, int wtTime)
          Waits for the cursor to appear at the specified position, for a specified period of time.
 void waitForString(java.lang.String inText, int inRow, int inColumn, int wtTime)
          Waits for the specified text to appear at the specified position, for a specified period of time.
 void waitHostQuiet(int inSettleTime, int wtTime)
          Waits for the host session to be idle for a specified period of time (in milliseconds).
 
Methods inherited from interface com.attachmate.UPG.common.IScreenUPGInternal
OpenRemoteViewer, setInternalDBG, setView
 
Methods inherited from interface com.attachmate.UPG.common.IScreen
refreshEvents
 

Field Detail

copyright

public static final java.lang.String copyright
See Also:
Constant Field Values
Method Detail

isConnected

public boolean isConnected()
Returns the state of the Mainframe/Gateway connection: true if connected; false if unconnected.

Returns:
True or false. If the connection is open, the value is set to true; otherwise it is set to false.
Example:
boolean isConnectionOpen = m_screenObj.isConnected();

clearCapturedData

public void clearCapturedData()
Clears information from the captured data buffer by setting it to null. The data capture buffer allows you to save all information being sent to the presentation space for later retrieval as a byte array or a string.
Example:
m_screenObj.clearCapturedData();

See Also:
getCapturedData(), getCapturedBytes(), getDataCapture(), getMaxDataCaptureLength(), setDataCapture(boolean), setDataCaptureEx(boolean, boolean), setMaxDataCaptureLength(int)

fieldCount

public int fieldCount(int Type)
Returns the number of fields of the specified type.

Specified by:
fieldCount in interface com.attachmate.UPG.common.IScreen
Returns:
The number of fields found of the specified type.
Example:
int fieldCount = m_screenObj.fieldCount(m_screenObj.FIELDTYPE_PROTECTED);

findField

public boolean findField(int inRow,
                         int inCol,
                         int inMode,
                         int inType,
                         int inWrap,
                         MutableInt outRow,
                         MutableInt outColumn,
                         MutableInt outLength,
                         MutableInt outAttribute)
Searches the presentation space for the specified field, beginning from the row and column position specified. For example, if you set both inRow and inCol to 1, and set inMode to FINDFIELD_NEXT, it will search for the next field that follows the specified position. If the specified field is found, returns true and the field's boundaries.

Specified by:
findField in interface com.attachmate.UPG.common.IScreen
Parameters:
inRow - The row in which to begin searching.
inCol - The column in which to begin searching.
inMode - The field to look for: current, next, or previous (from the specified row and column position). Possible values include: FINDFIELD_CURRENT, FINDFIELD_NEXT, and FINDFIELD_PREVIOUS.
inType - The type of field to search for. Possible values include: FIELDTYPE_ANY, FIELDTYPE_PROTECTED, and FIELDTYPE_UNPROTECTED.
inWrap - Whether or not to wrap to the top after reaching the end of the presentation space. Possible values include: WRAP_ON and WRAP_OFF.
outRow - The row where the field was found. If the field is not found, the value is set to zero.
outColumn - The column where the field was found. If the field is not found, the value is set to zero.
outLength - The length of the field that was found. If the field is not found, the value is set to zero.
outAttribute - A value representing the field attribute bits of the specified field. See Field Attributes for a list of field attributes returned for each host type.
Returns:
True or false. If the field is found, the value is set to true; otherwise it is set to false.
Examples:
Java:

int inRow = 1;
int inCol = 1;
int inMode = m_screenObj.FINDFIELD_NEXT;
int inType = m_screenObj.FIELDTYPE_PROTECTED;
int inWrap = m_screenObj.WRAP_ON;
MutableInt outRow = new MutableInt(0);
MutableInt outColumn = new MutableInt(0);
MutableInt outLength = new MutableInt(0);
MutableInt outAttribute = new MutableInt(0);

boolean fieldFound = m_screenObj.findField(inRow, inCol,
   inMode, inType, inWrap, outRow, outColumn,
   outLength, outAttribute );

ASP (VBScript):

set oRow = CreateObject("Mutable.MutableInt")
set oCol = CreateObject("Mutable.MutableInt")
set oLen = CreateObject("Mutable.MutableInt")
set oAttr = CreateObject("Mutable.MutableInt")
dim inMode
dim inType
dim inWrap
oRow = 0
oCol = 0
oLen = 0
inMode = Session("screenObj").FINDFIELD_NEXT
inType = Session("screenObj").FIELDTYPE_PROTECTED
inWrap = Session("screenObj").WRAP_ON
dim findField

findField  = Session("screenObj").findField (1, 1, inMode,
    inType, inWrap, oRow, oCol,oLen, oAttr)

C++:

int inRow = 1;
int inCol = 1;
int inMode = FINDFIELD_NEXT;
int inType = FIELDTYPE_PROTECTED;
int inWrap = WRAP_ON;
MutableInt_Dispatch outRow;
MutableInt_Dispatch outColumn;
MutableInt_Dispatch outLength;
MutableInt_Dispatch outAttribute;
::CLSIDFromProgID(L"Mutable.MutableInt", &clsid);
outRow.CreateDispatch(clsid);
outColumn.CreateDispatch(clsid);
outLength.CreateDispatch(clsid);
outAttribute.CreateDispatch(clsid);

boolean fieldFound = m_screenObj.findField(inRow, inCol,
    inMode, inType, inWrap, outRow, outColumn,
    outLength, outAttribute );
int x = outRow.getInt();
int y = outColumn.getInt();
See Also:
findFieldEx(int, int, int, int, com.attachmate.common.types.MutableInt, com.attachmate.common.types.MutableInt, com.attachmate.common.types.MutableInt, com.attachmate.common.types.MutableInt)

findFieldEx

public boolean findFieldEx(int inbeginIndex,
                           int inMode,
                           int inType,
                           int inWrap,
                           MutableInt outRow,
                           MutableInt outCol,
                           MutableInt outLength,
                           MutableInt outAttribute)
Searches the presentation space for the specified field, beginning from the index (field number) specified. For example, if you set beginIndex to 1 and set inMode to FINDFIELD_NEXT, it will search for the second field (the next field following field 1). If the specified field is found, returns true and the field's boundaries.

Parameters:
inMode - The field to look for: current, next, or previous (from the specified index). Possible values include: FINDFIELD_CURRENT, FINDFIELD_NEXT, and FINDFIELD_PREVIOUS.
inType - The type of field to search for. Possible values include: FIELDTYPE_ANY, FIELDTYPE_PROTECTED, and FIELDTYPE_UNPROTECTED.
inWrap - Whether or not to wrap to the top after reaching the end of the presentation space. Possible values include: WRAP_ON and WRAP_OFF.
outRow - The row where the field was found. If the field is not found, the value is set to zero.
outLength - The length of the field that was found. If the field is not found, the value is set to zero.
outAttribute - A value representing the field attribute bits of the specified field. See Field Attributes for a list of field attributes returned for each host type.
Returns:
True or false. If the field is found, the value is set to true; otherwise it is set to false.
Examples:
Java:

int beginIndex = 1;
int inMode = m_screenObj.FINDFIELD_NEXT;
int inType = m_screenObj.FIELDTYPE_PROTECTED;
int inWrap = m_screenObj.WRAP_ON;
MutableInt outRow = new MutableInt(0);
MutableInt outColumn = new MutableInt(0);
MutableInt outLength = new MutableInt(0);
MutableInt outAttribute = new MutableInt(0);

boolean fieldFound = m_screenObj.findField(beginIndex,
   inMode, inType, inWrap, outRow, outColumn,
   outLength, outAttribute );

ASP (VBScript):

set oRow = CreateObject("Mutable.MutableInt")
set oCol = CreateObject("Mutable.MutableInt")
set oLen = CreateObject("Mutable.MutableInt")
set oAttr = CreateObject("Mutable.MutableInt")
dim inMode
dim inType
dim inWrap
oRow = 0
oCol = 0
oLen = 0
inMode = Session("screenObj").FINDFIELD_NEXT
inType = Session("screenObj").FIELDTYPE_PROTECTED
inWrap = Session("screenObj").WRAP_ON
dim findField

findField  = Session("screenObj").findField (1, inMode,
    inType, inWrap, oRow, oCol,oLen, oAttr)

C++:

int beginIndex = 1;
int inMode = FINDFIELD_NEXT;
int inType = FIELDTYPE_PROTECTED;
int inWrap = WRAP_ON;
MutableInt_Dispatch outRow;
MutableInt_Dispatch outColumn;
MutableInt_Dispatch outLength;
MutableInt_Dispatch outAttribute;
::CLSIDFromProgID(L"Mutable.MutableInt", &clsid);
outRow.CreateDispatch(clsid);
outColumn.CreateDispatch(clsid);
outLength.CreateDispatch(clsid);
outAttribute.CreateDispatch(clsid);

boolean fieldFound = m_screenObj.findField(beginIndex,
    inMode, inType, inWrap, outRow, outColumn,
    outLength, outAttribute );
int x = outRow.getInt();
int y = outColumn.getInt();
See Also:
findField(int, int, int, int, int, com.attachmate.common.types.MutableInt, com.attachmate.common.types.MutableInt, com.attachmate.common.types.MutableInt, com.attachmate.common.types.MutableInt)

findString

public boolean findString(java.lang.String inText,
                          int inStartRow,
                          int inStartColumn,
                          MutableInt outRow,
                          MutableInt outColumn)
Searches the presentation space for the specified text string, starting at the specified position. If the text is found, returns true and the start position of the string.

Specified by:
findString in interface com.attachmate.UPG.common.IScreen
Parameters:
inText - The text to search for.
inStartRow - The row in which to begin searching.
inStartColumn - The column in which to begin searching.
outRow - The row where the string was found. If the string is not found, the value is set to zero.
outColumn - The column where the string was found. If the string is not found, the value is set to zero.
Returns:
True or false. If the string is found, the value is set to true; otherwise it is set to false.
Examples:
Java:

String inText = "PASSWORD";
inStartRow = 1;
inStartColumn = 1;
MutableInt outRow = new MutableInt(0);
MutableInt outColumn = new MutableInt(0);

boolean stringFound = m_screenObj.findString(inText, inStartRow,
   inStartColumn, outRow, outColumn );

ASP (VBScript):

dim inText
inText= "LOGON"
inStartRow = 1
inStartColumn = 1
set outRow = CreateObject("Mutable.MutableInt")
set outColumn = CreateObject("Mutable.MutableInt")
dim stringFound

stringFound = Session("screenObj").findString(inText, inStartRow,
   inStartColumn, outRow, outColumn )

C++:

MutableInt_Dispatch outRow;
MutableInt_Dispatch outColumn;
::CLSIDFromProgID(L"Mutable.MutableInt", &clsid);
outRow.CreateDispatch(clsid);
outColumn.CreateDispatch(clsid);
CString inText = "LOGON";
int inStartRow = 1;
int inStartColumn = 1;

bool stringFound = m_screenObj.findString((LPCSTR)inText, inStartRow,
    inStartColumn, outRow, outColumn );
int x = outRow.getInt();
int y = outColumn.getInt();
See Also:
findStringEx(java.lang.String, int, int, int, int, int, int, int, com.attachmate.common.types.MutableInt, com.attachmate.common.types.MutableInt)

findStringEx

public boolean findStringEx(java.lang.String inText,
                            int inStartRow,
                            int inStartColumn,
                            int inEndRow,
                            int inEndColumn,
                            int inArea,
                            int inWrap,
                            int inDir,
                            MutableInt outRow,
                            MutableInt outColumn)
Searches the presentation space for the specified text string, from the specified start position to the specified end position. If found, it returns true and the start position of the string. Detected field attributes or hidden fields are treated as spaces.

Specified by:
findStringEx in interface com.attachmate.UPG.common.IScreen
Parameters:
inText - The text to search for.
inStartRow - The row in which to begin searching.
inStartColumn - The column in which to begin searching.
inEndRow - The row in which to stop searching.
inEndColumn - The column in which to stop searching.
inArea - Not used; set to 0.
inWrap - Whether or not to wrap to the top after reaching the end of the presentation space. Possible values include: WRAP_ON and WRAP_OFF.
inDir - The direction to search when looking for the string. When searching backwards, searching begins at the end of the selected area. Possible values include: DIRECTION_BACKWARD and DIRECTION_FORWARD.
outRow - The row where the string was found. If the string is not found, the value is set to zero.
outColumn - The column where the string was found. If the string is not found, the value is set to zero.
Returns:
True or false. If the string is found, the value is set to true; otherwise it is set to false.
Examples:
Java:

String inText = "PASSWORD";
inStartRow = 1;
inStartColumn = 1;
inEndRow = 12;
inEndColumn = 80;
inArea = 0;
inWrap = m_screenObj.WRAP_ON;
inDir = m_screenObj.DIRECTION_FORWARD;
MutableInt outRow = new MutableInt(0);
MutableInt outColumn = new MutableInt(0);

boolean stringFound = m_screenObj.findStringEx(inText, inStartRow,
   inStartColumn,inEndRow, inEndColumn, inArea,
   inWrap, inDir, outRow, outColumn );

ASP (VBScript):

dim inText
inText= "LOGON"
inStartRow = 1
inStartColumn = 1
set outRow = CreateObject("Mutable.MutableInt")
set outColumn = CreateObject("Mutable.MutableInt")
dim stringFound
inEndRow = 12
inEndColumn = 80
inArea = 0
inWrap = Session("screenObj").WRAP_ON
inDir = Session("screenObj").DIRECTION_FORWARD

stringFound = Session("screenObj").findStringEx(inText, inStartRow,
   inStartColumn, inEndRow, inEndColumn, inArea, inWrap, inDir, outRow,
   outColumn

C++:

MutableInt_Dispatch outRow;
MutableInt_Dispatch outColumn;
::CLSIDFromProgID(L"Mutable.MutableInt", &clsid);
outRow.CreateDispatch(clsid);
outColumn.CreateDispatch(clsid);
CString inText = "LOGON";
int inStartRow = 1;
int inStartColumn = 1;
int inEndRow = 12;
int inEndColumn = 80;
int inArea = 0;
int inWrap = WRAP_ON;
int inDir = DIRECTION_FORWARD;

boolean stringFound = m_screenObj.findStringEx((LPCSTR)inText, inStartRow,
    inStartColumn,inEndRow, inEndColumn, inArea,
    inWrap, inDir, outRow, outColumn );
int x = outRow.getInt();
int y = outColumn.getInt();
See Also:
findString(java.lang.String, int, int, com.attachmate.common.types.MutableInt, com.attachmate.common.types.MutableInt)

getCapturedData

public java.lang.String getCapturedData()
Returns the currently captured data as a String. The data capture facility allows you to save all information being sent by the host communications layer to the presentation space for later retrieval as a byte array or a String. Depending on the type of terminal and type of host connection, this data may be in the 8-bit ASCII, 8-bit EBCDIC or 6-bit ALC character set.

Returns:
A string containing the data that is currently captured. Note that this does not remove the data from the capture buffer.
Example:
String gcd = m_screenObj.getCapturedData();
See Also:
clearCapturedData(), getCapturedBytes(), getDataCapture(), getMaxDataCaptureLength(), setDataCapture(boolean), setDataCaptureEx(boolean, boolean), setMaxDataCaptureLength(int)

getCapturedBytes

public byte[] getCapturedBytes()
Returns the currently captured data as a byte array. The data capture facility allows you to save all information being sent by the host communications layer to the presentation space for later retrieval as a byte array or a String. Depending on the type of terminal and type of host connection, this data may be in the 8-bit ASCII, 8-bit EBCDIC or 6-bit ALC character set.

Returns:
A byte array containing the data that is currently captured. Note that this does not remove the data from the capture buffer.
Example:
String gcd = m_screenObj.getCapturedBytes();
See Also:
clearCapturedData(), getCapturedData(), getDataCapture(), getMaxDataCaptureLength(), setDataCapture(boolean), setDataCaptureEx(boolean, boolean), setMaxDataCaptureLength(int)

getColumns

public int getColumns()
Returns the number of columns in the current presentation space.

Specified by:
getColumns in interface com.attachmate.UPG.common.IScreen
Returns:
The number of columns.
Example:
int numColumns = m_screenObj.getColumns();
See Also:
getRows()

getRows

public int getRows()
Returns the number of rows in the presentation space.

Specified by:
getRows in interface com.attachmate.UPG.common.IScreen
Returns:
The number of rows.
Example:
int numRows = m_screenObj.getRows();
See Also:
getColumns()

getScreenType

public int getScreenType()
Returns the current host type. Possible values (defined in class com.attachmate.UPG.common.IScreenUPG): SCREEN_3270, SCREEN_5250, SCREEN_ALC, SCREEN_T27, SCREEN_UTS, SCREEN_VT.

Specified by:
getScreenType in interface com.attachmate.UPG.common.IScreen
Returns:
The current host type.
Example:
int screenType = m_screenObj.getScreenType();

setOperatorDisable

public void setOperatorDisable(boolean b)
Attempts to set Operator Disabled status for MATIP sessions.

Parameters:
b - True if session is to be disabled, false to enable it.
Example:
m_screenObj.setOperatorDisable(true);
See Also:
getOperatorDisable()

getOperatorDisable

public boolean getOperatorDisable()
Gets the current Operator Disabled status for MATIP sessions.

Returns:
True if session has been disabled.
Example:
m_screenObj.getOperatorDisable();
See Also:
setOperatorDisable(boolean)

getPeripheralControl

public boolean getPeripheralControl()
Gets the current Peripheral Control State for UTS INT-1 sessions.

Returns:
True if session has Peripheral Control enabled.
See Also:
setPeripheralControl(boolean)

setPeripheralControl

public void setPeripheralControl(boolean sPerCntrl)
Sets the Peripheral Control State for UTS INT-1 sessions.
This advanced feature is for applications that want control over print activity.

The "setPeripheralControl" method is called for an application to either establish or relinquish control over peripheral status response generation (i.e. it is used to change modes). "getPeripheralControl" is used to check to see if the application has control over the peripheral generation mechanism, or not (i.e. to determine which mode the SDK is in). By default, an application does NOT have control over peripheral responses (the SDK automatically handles answering/ACKing print operations). If the application desires to have control over peripheral responses (meaning that the SDK will not generate peripheral THRUs automatically), then pass "True" to enable. In the mode where the application has control, the application is responsible for generating peripheral responses by calling the SendStatus method after each host print operation.

The relevant arguments for the SendStatus method are:

"UTS_DEVICESTATUS" for the first parameter (Type) when dealing with UTS/INT-1 statuses.

The second parameter should be a 1 byte value of one of the following:
"UTS_DEVICESTATUS_THRU" for an Acknowledgement/Thru
"UTS_DEVICESTATUS_ERROR" for an Error/NACK
"UTS_DEVICESTATUS_NOTREADY" for a slightly different Error
"UTS_DEVICESTATUS_OFFLINE" for another slightly different error
"UTS_DEVICESTATUS_POC" for a Power-on Confidence (should only be used at StartUp)

If an application wants to control INT-1 peripheral responses it should call "setPeripheralControl(TRUE)" at startup, and then check that "getPeripheralControl()" confirms that with a returned value of TRUE. Then after every text message is received for the printer, the application should call SendStatus with one of the possible arguments. The first two values (UTS_DEVICESTATTUS_THRU and UTS_DEVICESTATUS_ERROR) will likely be sufficient. Calling SendStatus when a print operation is not outstanding will result in no peripheral status being sent to the host.

As an aide to tell when the application should be sending a printer status, the "getOIAContents" method can be used. The UTS OIA data contains two pieces of data which the application may want to check. Byte 102 is the Printer DID. If PeripheralControl is set TRUE, then this byte 102 value will be the currently selected printer DID (normally 0x73) or 0 if no Printer DID is selected. A Byte 104 has been added to the UTS OIA data - which is a "Printer Status Response" indication. This is intended as a aide in determine when the host is performing a print operation. The "Printer Status Response" byte is 1 if a printer status response is outstanding (i.e. the application needs to call SendStatus to complete the host operation), and 0 otherwise. If PeripheralControl is set to false, then byte 104 will always be 0.

Parameters:
sPerCntrl - True to enable, False to disable, application control of peripheral responses.
Example:
m_screenObj.setPeripheralControl(false);
See Also:
getPeripheralControl(), SendStatus(int, byte[]), getOIAContents()

getString

public java.lang.String getString(int inStartRow,
                                  int inStartColumn,
                                  int inLength)
Returns the visible text from the specified location. If inStartRow and inStartColumn are zero, the entire presentation space is returned.

Specified by:
getString in interface com.attachmate.UPG.common.IScreen
Parameters:
inStartRow - The first row from which to retrieve data.
inStartColumn - The first column from which to retrieve data.
inLength - The number of presentation space positions to return. Ignored when both inStartRow and inStartColumn are zero.
Returns:
The text string.
Examples:
Java:

int inStartRow = 1;
int inStartColumn = 1;
int inLength = 12;

String visibleString = m_screenObj.getString (inStartRow,
   inStartColumn, inLength );

ASP (VBScript):

dim inStartRow
dim inStartColumn
dim inLength
inStartRow = 0
inStartColumn = 0
inLength = 12
dim str

str = Session("screenObj").getString (inStartRow,
   inStartColumn, inLength) 

C++:

MutableInt_Dispatch outRow;
MutableInt_Dispatch outColumn;
::CLSIDFromProgID(L"Mutable.MutableInt", &clsid);
outRow.CreateDispatch(clsid);
outColumn.CreateDispatch(clsid);
int inStartRow = 3;
int inStartColumn = 1;
int inLength = 40;
CString visibleString = m_screenObj.getString (inStartRow,
    inStartColumn, inLength);
See Also:
getStringEx(int, int, int, int, int, int, int, int)

getStringEx

public java.lang.String getStringEx(int inStartRow,
                                    int inStartColumn,
                                    int inEndRow,
                                    int inEndColumn,
                                    int inArea,
                                    int inWrap,
                                    int inAttr,
                                    int inFlags)
Returns text from the specified location, for attributes matching those specified by inAttr. If inStartRow and inStartColumn are zero, the entire presentation space is returned.

Specified by:
getStringEx in interface com.attachmate.UPG.common.IScreen
Parameters:
inStartRow - The first row from which to retrieve data.
inStartColumn - The first column from which to retrieve data.
inEndRow - The last row from which to retrieve data. Ignored when both inStartRow and inStartColumn are zero.
inEndColumn - The last column from which to retrieve data. Ignored when both inStartRow and inStartColumn are zero.
inArea - Not used; set to 0.
inWrap - Whether or not to wrap to the top after reaching the end of the presentation space. Possible values include: WRAP_ON and WRAP_OFF.
inAttr - The type of fields to retrieve. You can connect multiple options with OR to create various combinations. For example, SCREENATTR_UNPROTECTED | SCREENATTR_VISIBLE returns only unprotected, visible fields. Possible values include: SCREENATTR_ANY, SCREENATTR_HIDDEN, SCREENATTR_PROTECTED, SCREENATTR_UNPROTECTED, and SCREENATTR_VISIBLE.
inFlags - Not used; set to 0.
Returns:
The string at the specified location.
Examples:
Java:

int inStartRow = 1;
int inStartColumn = 1;
int inEndRow = 12;
int inEndColumn = 10;
int inArea = 0;
int inWrap = m_screenObj.WRAP_ON;
int inAttr = m_screenObj.SCREENATTR_PROTECTED;
int inFlags = 0;

String matchString = m_screenObj.getStringEx (inStartRow,
   inStartColumn, inEndRow, inEndColumn, inArea,
   inWrap, inAttr, inFlags);

ASP (VBScript):

inStartRow = 1
inStartColumn = 1
inEndRow = 12
inEndColumn = 10
inArea = 0
inWrap = Session("screenObj").WRAP_ON
inAttr = Session("screenObj").SCREENATTR_PROTECTED
inFlags = 0
dim matchString

matchString = Session(“screenObj”).getStringEx (inStartRow,
   inStartColumn, inEndRow, inEndColumn, inArea, inWrap, inAttr,
   inFlags)

C++:

int inStartRow = 1;
int inStartColumn = 1;
int inEndRow = 12;
int inEndColumn = 10;
int inArea = 0;
int inWrap = WRAP_ON;
int inAttr = SCREENATTR_PROTECTED;
int inFlags = 0;
CString matchString = m_screenObj.getStringEx (inStartRow,
    inStartColumn, inEndRow, inEndColumn, inArea,
    inWrap, inAttr, inFlags );
See Also:
getString(int, int, int)

getCursor

public void getCursor(MutableInt outRow,
                      MutableInt outColumn)
Returns the current cursor position.

Specified by:
getCursor in interface com.attachmate.UPG.common.IScreen
Parameters:
outRow - The current cursor row.
outColumn - The current cursor column.
Examples:
Java:

MutableInt outRow = new MutableInt(0);
MutableInt outColumn = new MutableInt(0);

m_screenObj.getCursor(outRow, outColumn);


ASP (VBScript):

set outRow = CreateObject("Mutable.MutableInt")
set outColumn = CreateObject("Mutable.MutableInt")
outRow= 0
outColumn = 0

Session("screenObj").getCursor(outRow, outColumn)


C++:

MutableInt_Dispatch outRow;
MutableInt_Dispatch outColumn;
::CLSIDFromProgID(L"Mutable.MutableInt", &clsid);
outRow.CreateDispatch(clsid);
outColumn.CreateDispatch(clsid);

m_screenObj.getCursor(outRow, outColumn);

int x = outRow.getInt();
int y = outColumn.getInt();
See Also:
getCursorColumn(), getCursorRow(), setCursor(int, int), setCursorColumn(int), setCursorRow(int)

getCursorColumn

public int getCursorColumn()
Returns the column of the current cursor position. A value of 1 is the left edge of the presentation space.

Specified by:
getCursorColumn in interface com.attachmate.UPG.common.IScreen
Returns:
The current cursor column.
Example:
int currentCursorColumn = m_screenObj.getCursorColumn();
See Also:
getCursor(com.attachmate.common.types.MutableInt, com.attachmate.common.types.MutableInt), getCursorRow(), setCursor(int, int), setCursorColumn(int), setCursorRow(int)

setCursor

public void setCursor(int inRow,
                      int inColumn)
               throws CursorPositionException
Sets the cursor position on the presentation space.

Specified by:
setCursor in interface com.attachmate.UPG.common.IScreen
Parameters:
inRow - The row in which the cursor is placed.
inColumn - The column in which the cursor is placed.
Example:
int inRow = 17;
int inColumn = 20;

m_screenObj.setCursor(inRow, inColumn);
Throws:
CursorPositionException
See Also:
setCursorColumn(int), setCursorRow(int), getCursor(com.attachmate.common.types.MutableInt, com.attachmate.common.types.MutableInt), getCursorColumn(), getCursorRow()

setCursorColumn

public void setCursorColumn(int CursorColumn)
                     throws CursorPositionException
Sets the column of the cursor position.

Specified by:
setCursorColumn in interface com.attachmate.UPG.common.IScreen
Throws:
CursorPositionException
See Also:
setCursor(int, int), setCursorRow(int), getCursor(com.attachmate.common.types.MutableInt, com.attachmate.common.types.MutableInt), getCursorColumn(), getCursorRow()

setCursorRow

public void setCursorRow(int CursorRow)
                  throws CursorPositionException
Sets the row of the cursor position.

Specified by:
setCursorRow in interface com.attachmate.UPG.common.IScreen
Throws:
CursorPositionException
See Also:
setCursor(int, int), setCursorColumn(int), getCursor(com.attachmate.common.types.MutableInt, com.attachmate.common.types.MutableInt), getCursorColumn(), getCursorRow()

getCursorRow

public int getCursorRow()
Returns the row of the current cursor position. A value of 1 is the top row of the presentation space.

Specified by:
getCursorRow in interface com.attachmate.UPG.common.IScreen
Returns:
The current cursor row.
Example:
int currentCursorRow = m_screenObj.getCursorRow();
See Also:
getCursor(com.attachmate.common.types.MutableInt, com.attachmate.common.types.MutableInt), getCursorColumn(), setCursor(int, int), setCursorColumn(int), setCursorRow(int)

getDataCapture

public boolean getDataCapture()
Returns the current state of the data capture facility: true if on; false if off. The data capture facility allows you to save all information being sent to the presentation space to a string. The data capture facility is initially set to off until you activate it.

Returns:
True or false. If the data capture facility is on, the value is set to true; otherwise it is set to false.
Example:
boolean gDC = m_screenObj.getDataCapture();
See Also:
clearCapturedData(), getCapturedData(), getCapturedBytes(), getMaxDataCaptureLength(), setDataCapture(boolean), setDataCaptureEx(boolean, boolean), setMaxDataCaptureLength(int)

getExtPS

public java.lang.String getExtPS(int Row,
                                 int Col,
                                 int PSLength)
Returns the specified portion of the presentation space in a string format. Each character in the returned string is followed immediately by the extended character and extended color information for that character; as a result, the return string will contain three times the number of presentation space positions (characters) that you specify. See Extended Character and Color Attributes for a list of attributes returned for each Host Type.

Returns:
A string containing the specified contents of presentation space. The string includes the requested presentation space positions (characters), as well as the extended character and extended color attributes for each character.
Example:
Java:

boolean isUnderscore = false;
boolean isBlinking = false;
boolean isForegroundBlue = false;
boolean isBackgroundYellow = false;

String ps;
ps = ScreenObj.getExtPS(1,1,1000);
char display_character = ps.charAt(0);
char character_Attribute = ps.charAt(1);
char character_color = ps.charAt(2);

// Character attributes
if ((character_Attribute & ScreenObj.Underscore) != 0)
  isUnderscore = true;
if ((character_Attribute & ScreenObj.Blink) != 0)
  isBlinking = true;

// Character color attributes
if ((character_color & ScreenObj.FgBlue) != 0)
  isForegroundBlue = true;
if ((character_color & ScreenObj.BgYellow) != 0)
  isBackgroundYellow = true;


ASP (VBScript):

dim isBlink,isUnderline,isNegative
dim attribs
attribs = screenObj.getExtPS(18,6,10)
attr = mid(attribs,2,1)
if ((attr and screenObj.Blink) <> 0) then isBlink = true
if ((attr and screenObj.Underscore) <> 0) then isUnderline = true
if ((attr and screenObj.Reverse) <> 0) then isNegative = true


C++:

char attribs[50];
char attr;
bool isBlink, isUnderline, isNegative;
attribs = screenObj.getExtPS(18,6,10);
attr = attribs[1];
if ((attr & screenObj.Blink) != 0) isBlink = true;
if ((attr & screenObj.Underscore) != 0) isUnderline = true;
if ((attr & screenObj.Reverse) != 0) isNegative = true;
See Also:
getExtPSBytes(int, int, int)

getExtPSBytes

public byte[] getExtPSBytes(int Row,
                            int Col,
                            int PSLength)
Returns the specified portion of the presentation space in a byte array format. Each character in the returned byte array is followed immediately by the extended character and extended color information for that character; as a result, the return array will contain three times the number of presentation space positions (characters) that you specify. See Extended Character and Color Attributes for a list of attributes returned for each Host Type.

Returns:
A byte array containing the specified contents of presentation space. The array includes the requested presentation space positions (characters), as well as the extended character and extended color attributes for each character.
Example:
Java:

boolean isUnderscore = false;
boolean isBlinking = false;
boolean isForegroundBlue = false;
boolean isBackgroundYellow = false;

byte[] ps;
ps = ScreenObj.getExtPSBytes(1,1,1000);
char display_character = (char) ps[0];
char character_Attribute = (char) ps[1];
char character_color = (char) ps.charAt[2];

// Character attributes
if ((character_Attribute & ScreenObj.Underscore) != 0)
  isUnderscore = true;
if ((character_Attribute & ScreenObj.Blink) != 0)
  isBlinking = true;

// Character color attributes
if ((character_color & ScreenObj.FgBlue) != 0)
  isForegroundBlue = true;
if ((character_color & ScreenObj.BgYellow) != 0)
  isBackgroundYellow = true;


See Also:
getExtPS(int, int, int)

getMaxDataCaptureLength

public int getMaxDataCaptureLength()
Returns the current maximum buffer size for data captured using the data capture facility. The data capture facility allows you to save all information being sent to the presentation space by the host for later retrieval as a byte array or a string. The default value is 9600 bytes, which is the equivalent of 5 screens of data (5 x 1920). Any bytes that exceed the specified buffer size are truncated.

Returns:
int The current maximum buffer size (in bytes).
Example:
int mdcl = m_screenObj.getMaxDataCaptureLength();
See Also:
clearCapturedData(), getCapturedData(), getCapturedBytes(), getDataCapture(), setDataCapture(boolean), setDataCaptureEx(boolean, boolean), setMaxDataCaptureLength(int)

getOIAContents

public java.lang.String getOIAContents()
Returns the data displayed in the OIA portion (status line) of the presentation space. See OIA Data for a detailed list of OIA data returned for a session.

Returns:
A string containing the data displayed in the OIA portion of the presentation space.
Examples:
Java:

String tmpstr;
tmpstr = screenObj.getOIAContents();
int conn;
//get connection status
conn = tmpstr.charAt(83);


ASP (VBScript):

dim tmpstr,conn
tmpstr = screenObj.getOIAContents
'get connection status
conn = asc(mid(tmpstr,84,1))


C++:

CString tmpStr;
tmpStr = screenObj.getOIAContents();
int conn;
//get connection status
conn = tmpstr.getAt(83);
See Also:
getOIAByteContents(), getOIAText()

getOIAByteContents

public byte[] getOIAByteContents()
Returns the data displayed in the OIA portion (status line) of the presentation space. See OIA Data for a detailed list of OIA data returned for a session.

Returns:
A byte array containing the data displayed in the OIA portion of the presentation space.
Examples:
Java:

byte[] tmpbytes;
tmpbytes = screenObj.getOIAByteContents();
int conn;
// get connection status
conn = tmpbytes[83];


See Also:
getOIAContents(), getOIAText()

getText

public java.lang.String getText()
Returns the text contents of the presentation space as a string. The string returned has a CR/LF at the end of each line of the presentation space. If the getText_Display property has been set to True, the getText() method writes the entire text contents of the current presentation space to Standard out, which can be useful for debugging and diagnostic purposes.

Specified by:
getText in interface com.attachmate.UPG.common.IScreen
Returns:
A string containing the text of the presentation space.
Example:
String hostText = m_screenObj.getText();
See Also:
getgetText_Display(), setgetText_Display(boolean)

setDataCapture

public void setDataCapture(boolean sDCVal)
Turns the data capture facility on or off. Valid values are true to turn it on, or false to turn it off. The data capture facility allows you to save all information being sent to the presentation space by the host for later retrieval as a byte array or a string. The data capture facility is initially set to off until you activate it.

Parameters:
sDCVal - Specifies whether to turn the data capture facility on (true) or off (false).
Example:
m_screenObj.setDataCapture(true);
See Also:
clearCapturedData(), getCapturedData(), getCapturedBytes(), getDataCapture(), getMaxDataCaptureLength(), setDataCaptureEx(boolean, boolean), setMaxDataCaptureLength(int)

setDataCaptureEx

public void setDataCaptureEx(boolean sDCVal,
                             boolean sSPSUVal)
Turns the data capture facility on or off. Valid values are true to turn it on, or false to turn it off. The data capture facility allows you to save all information being sent to the presentation space by the host for later retrieval as a byte array or a string. The data capture facility is initially set to off until you activate it. In addition, turns on or off the suppression of updates to the presentation space. The value true will cause the captured data not to be sent to the presentation space. A setting of false will allow the presentation space to be updated with the captured data.

Parameters:
sDCVal - Specifies whether to turn the data capture facility on (true) or off (false).
sSPSUVal - Specifies whether to turn the suppression of presentation space updates on (true) or off (false).
Example:
m_screenObj.setDataCapture(true);
See Also:
clearCapturedData(), getCapturedData(), getCapturedBytes(), getDataCapture(), getMaxDataCaptureLength(), setDataCapture(boolean), setMaxDataCaptureLength(int)

getgetText_Display

public boolean getgetText_Display()
Returns the current setting of the getText_Display property. If getText_Display is set to true, the getText() method writes the entire text contents of the current presentation space to Standard out, which can be useful for debugging and diagnostic purposes.

Returns:
True or false. If getText_Display is enabled, the value is set to true; otherwise it is set to false.
Example:
boolean ggTD = m_screenObj.getgetText_Display();
See Also:
setgetText_Display(boolean)

setgetText_Display

public void setgetText_Display(boolean gtdvalue)
Turns the getText_Display property on or off. Valid values are true to turn it on, or false to turn it off. If getText_Display is set to true, the getText() method writes the entire text contents of the current presentation space to Standard out, which can be useful for debugging and diagnostic purposes.

Parameters:
gtdvalue - Specifies whether to turn the getText_Display property on (true) or off (false).
Example:
m_screenObj.setgetText_Display(false);
See Also:
getgetText_Display()

getKeyboardLocked

public boolean getKeyboardLocked()
Returns the current state of the keyboard: true if locked; false if unlocked.

Specified by:
getKeyboardLocked in interface com.attachmate.UPG.common.IScreen
Returns:
True or false. If the keyboard is locked, the value is set to true; otherwise it is set to false.
Example:
boolean isKeyboardLocked = m_screenObj.getKeyboardLocked();

isKeyboardLocked

public boolean isKeyboardLocked()
Returns the state of the keyboard: true if locked; false if unlocked.

Specified by:
isKeyboardLocked in interface com.attachmate.UPG.common.IScreen
Returns:
True or false. If the keyboard is locked, the value is set to true; otherwise it is set to false.
Example:
boolean isKeyboardLocked = m_screenObj.isKeyboardLocked();

setMaxDataCaptureLength

public void setMaxDataCaptureLength(int dcl)
Sets the maximum buffer size for data captured using the data capture facility. The data capture facility allows you to save all information being sent to the presentation space by the host for later retrieval as a byte array or a string. The default value is 9600 bytes, which is the equivalent of 5 screens of data (5 x 1920). Any bytes that exceed the specified size are truncated.

Parameters:
dcl - The maximum number of bytes to save in the buffer.
Example:
m_screenObj.setMaxDataCaptureLength(10000);
See Also:
clearCapturedData(), getCapturedData(), getCapturedBytes(), getDataCapture(), getMaxDataCaptureLength(), setDataCapture(boolean), setDataCaptureEx(boolean, boolean)

Close

public void Close()
Closes the current host session.
Example:
m_screenObj.Close()

See Also:
Open()

Open

public boolean Open()
Opens a host session. Note: Open may return before the host connection has been established. The developer should check for a true value returned by isConnected before calling additional API methods.

Returns:
True or false. If the session is opened (or is currently open) successfully, the value is set to true; otherwise it is set to false.
Example:
boolean open_status = m_screenObj.Open();
See Also:
OpenEx(int), Close(), isConnected()

OpenEx

public boolean OpenEx(int timeout)
Opens a host session, waiting a specified time for the connection to be established before returning. Note: If the timeout is zero, OpenEx returns immediately, which may be before the host connection has been established. The developer should check for a true value returned by isConnected before calling additional API methods.

Returns:
True or false. If the session is opened (or is currently open) and connected to the host successfully, the value is set to true; otherwise it is set to false.
Example:
boolean open_status = m_screenObj.OpenEx(30);
See Also:
Close(), isConnected()

putString

public int putString(java.lang.String inText,
                     int inRow,
                     int inColumn)
              throws ProtectedFieldException,
                     InputInhibitedException,
                     TruncatedException
Copies a string of text to the specified position in the presentation space, returning the number of characters written.
Note: putString only copies text (not keystrokes) to the presentation space, and will overwrite any existing text (it is not affected by enabling Insert mode). To send keystrokes (such as Transmit or Tab), or to insert characters, use sendKeys.

Specified by:
putString in interface com.attachmate.UPG.common.IScreen
Parameters:
inText - The text to copy to the presentation space.
inRow - The row in which to begin writing.
inColumn - The column in which to begin writing.
Returns:
The number of characters written.
Examples:
Java:

 try
 {
      // putString - Copies a string of text to the presentation space

      String inText = "PASSWORD";
      int inRow = 1;
      int inColumn = 1;

      int numCharsPut = m_screenObj.putString (inText, inRow,
         inColumn );
 }
    catch(ProtectedFieldException e)
    {
       System.err.println("ProtectedFieldException " );
       return;
    }
    catch(InputInhibitedException e)
    {
       System.err.println("InputInhibitedException " );
       return;
    }
    catch(TruncatedException e)
    {
       System.err.println("TruncatedException " );
       return;
    }

ASP (VBScript):

inText = "password"
inRow = 5
inColumn = 11
numCharsPut = Session("screenObj").putString (inText, inRow,
   inColumn) 

C++:

 TRY
 {
    CString inText = "text";
    int inRow = 1;
    int inColumn = 1;
    int numCharsPut = m_screenObj.putString (inText, inRow, inColumn );
 }
 CATCH_ALL(e)
 {
    if (e->GetRuntimeClass()->m_lpszClassName == "com.attachmate.emulation.exception.ProtectedFieldException")
    {
    }
    else if (e->GetRuntimeClass()->m_lpszClassName == "com.attachmate.emulation.exception.InputInhibitedException")
    {
    }
    else if (e->GetRuntimeClass()->m_lpszClassName == "com.attachmate.emulation.exception.TruncatedException")
    {
    }
 }
 END_CATCH_ALL
Throws:
ProtectedFieldException - Returned if putString was not able to complete successfully because a protected field was encountered.
InputInhibitedException - Returned if putString was not able to complete successfully because a field with the input inhibited attribute was encountered.
TruncatedException - Returned if there is not enough room in the presentation space to write all of the data specified by putString.
See Also:
ScreenUPG#putStringEx, sendKeys(java.lang.String, int)

RawDataTransmit

public int RawDataTransmit(java.lang.String writeBuffer)
Writes a string of characters directly to the host communications layer, without going through the presentation space. The Unicode characters are converted to bytes with the default encoding for the platform. Depending on the type of terminal and type of host connection, this data may have to be in the 8-bit ASCII, 8-bit EBCDIC or 6-bit ALC character set.

Parameters:
writeBuffer - The text to send to the host.
Returns:
The status of the operation.
See Also:
RawDataTransmitBytes(byte[])

RawDataTransmitBytes

public int RawDataTransmitBytes(byte[] writeBuffer)
Writes an array of bytes directly to the host communications layer, without going through the presentation space. Depending on the type of terminal and type of host connection, this data may have to be in the 8-bit ASCII, 8-bit EBCDIC or 6-bit ALC character set.

Parameters:
writeBuffer - The data to send to the host.
Returns:
The status of the operation.
See Also:
RawDataTransmit(java.lang.String)

sendKeys

public void sendKeys(java.lang.String inText,
                     int inType)
Sends characters and special keys to the session. They are treated the same as if they were typed at the keyboard. For VT sessions they are transmitted to the host, while for the other host types they are written to the presentation space or acted upon at the current cursor position. Special keystrokes can be specified in HLLAPI format, which has a special code for each keystroke, such as "@E" for the host Transmit key, or Braces format, where the key name is surrounded by braces, such as "{Transmit}". See Key Codes for a complete list of codes for each host type.

You can also use sendKeys to send text character strings to the session. Text is sent to the host or written to the presentation space at the current cursor location. For example, to send the text "logoff" followed by the Transmit key, inText would be "logoff@T". If you are sending a lot of text to the presentation space, however, it may be more efficient to use putString or putStringEx instead. If an invalid key sequence is detected, no characters or keys are sent.

It is recommended that you follow every sendKey call with a call to one of the Wait methods (for example, WaitForString, WaitHostQuiet, or WaitForCursor). This helps to ensure that the host has completed processing before your application moves on to the next step.

Specified by:
sendKeys in interface com.attachmate.UPG.common.IScreen
Parameters:
inText - Keys to send to the session. This can be a combination of text characters and host keystrokes, however only one host keystroke can be sent in each call and the host keystroke must be the last key sent. Please see Key Codes for valid codes for each host type.
inType - The format of the host keystrokes included in the string, either HLLAPI format or BRACES format.
Example:
IScreenUPG screenObj = terminal.getSession().getScreen();

// send Transmit key at current cursor position
screenObj.sendKeys("@E",screenObj.KEYTYPE_HLLAPI);

// The next line is equivalent to the line above
screenObj.sendKeys("{Transmit}",screenObj.KEYTYPE_BRACES);
See Also:
putString(java.lang.String, int, int), putStringEx(java.lang.String, int, int, int, int, int, int, int, boolean)

SendStatus

public int SendStatus(int type,
                      byte[] detail)
Sends a status message with option detail to screen.

Parameters:
type - status message to send to screen.
detail - null or byte[] of status message detail if required.
Returns:
The status of the operation.

putStringEx

public int putStringEx(java.lang.String inText,
                       int inStartRow,
                       int inStartColumn,
                       int inEndRow,
                       int inEndColumn,
                       int inArea,
                       int inWrap,
                       int inModes,
                       boolean inFill)
                throws ProtectedFieldException,
                       InputInhibitedException,
                       TruncatedException
Copies a string of text to the specified position in the presentation space, returning the number of characters written. Similar to putString, but allows additional options. Data can be copied in block or stream mode, and can be copied to multiple unprotected fields. If inFill is true, the area is filled with the text specified by inText. Any characters that exceed the area are truncated.
Note: putStringEx only copies text (not keystrokes) to the presentation space, and will overwrite any existing text (it is not affected by enabling Insert mode). To send keystrokes (such as Transmit or Tab), or to insert characters, use sendKeys.

Specified by:
putStringEx in interface com.attachmate.UPG.common.IScreen
Parameters:
inText - The text to copy to the presentation space.
inStartRow - The row at which to begin writing.
inStartColumn - The column at which to begin writing.
inEndRow - The row at which to stop writing.
inEndColumn - The column at which to stop writing.
inArea - Not used; set to 0.
inWrap - Whether or not to wrap to the top after reaching the end of the presentation space. Possible values include: WRAP_ON and WRAP_OFF.
inModes - Action to perform when a protected field is encountered while writing the string to the presentation space. Possible values include: PUTSTRING_SKIP, PUTSTRING_SPAN, and PUTSTRING_STOP.
inFill - When true, the area specified is filled with the string specified by inText.
Returns:
The number of characters written.
Throws:
ProtectedFieldException - Returned if putStringEx was not able to complete successfully because a protected field was encountered.
InputInhibitedException - Returned if putStringEx was not able to complete successfully because a field with the input inhibited attribute was encountered.
TruncatedException - Returned if there is not enough room in the presentation space to write all of the data specified by putStringEx.
Examples:
Java:

 try
 {
      //  putStringEx - Writes to the specified position,
      //  returning the number of characters put

      String inText = "PASSWORD";
      int inStartRow = 1;
      int inStartColumn = 1;
      int inEndRow = 12;
      int inEndColumn = 10;
      int inArea = 0;
      int inWrap =  m_screenObj.WRAP_ON;
      int inModes = m_screenObj.FINDFIELD_NEXT;
      boolean inFill = true;

      int numCharsPut = m_screenObj.putStringEx (inText, inStartRow,
         inStartColumn,inEndRow, inEndColumn, inArea,
         inWrap, inModes, inFill);
 }
    catch(ProtectedFieldException e)
    {
       System.err.println("ProtectedFieldException " );
       return;
    }
    catch(InputInhibitedException e)
    {
       System.err.println("InputInhibitedException " );
       return;
    }
    catch(TruncatedException e)
    {
       System.err.println("TruncatedException " );
       return;
    }

ASP (VBScript):

inText = "password"
inRow = 5
inColumn = 11
inEndRow = 12
inEndColumn = 10
inArea = 0
inWrap = Session("screenObj").WRAP_ON
inModes = Session("screenObj").FINDFIELD_NEXT
numCharsPut = Session("screenObj").putStringEx (inText,
   inRow, inColumn, inEndRow, inEndColumn, inArea, inWrap,
   inModes, true)

C++:

 TRY
 {
    CString inText = "PASSWORD";
    int inStartRow = 1;
    int inStartColumn = 1;
    int inEndRow = 12;
    int inEndColumn = 10;
    int inArea = 0;
    int inWrap =  WRAP_ON;
    int inModes = FINDFIELD_NEXT;
    bool inFill = true;
    int numCharsPut = m_screenObj.putStringEx (inText, inStartRow,
    inStartColumn,inEndRow, inEndColumn, inArea, inWrap, inModes, inFill);
 }
 CATCH_ALL(e)
 {
    if (e->GetRuntimeClass()->m_lpszClassName == "com.attachmate.emulation.exception.ProtectedFieldException")
    {
    }
    else if (e->GetRuntimeClass()->m_lpszClassName == "com.attachmate.emulation.exception.InputInhibitedException")
    {
    }
    else if (e->GetRuntimeClass()->m_lpszClassName == "com.attachmate.emulation.exception.TruncatedException")
    {
    }
 }
 END_CATCH_ALL
See Also:
putString(java.lang.String, int, int), sendKeys(java.lang.String, int)

getObjectVersion

public int getObjectVersion()
Returns the version number of the specified Screen object (4xxxyyy); for example, 3001000 is equivalent to version 3.1.00.

Returns:
The Screen object version.
Examples:
Java:

int objVersion = m_screenObj.getObjectVersion();

ASP (VBScript):

int objVersion = Session("screenObj").getObjectVersion

C++:

int objVersion = m_screenObj.getObjectVersion();

getLastError

public java.lang.String getLastError()
Returns a description of the most recent error that occurred.

Returns:
An integer (error number) plus a text description of the error.
Examples:
Java:

String SDK_Error = screenObj.getLastError();

ASP (VBScript):

dim SDK_Error
SDK_Error = Session("screenObj").getLastError


C++:

CString SDK_Error = screenObj.getLastError();

setDescription

public void setDescription(java.lang.String description)
Creates a custom description for the Screen object. The description you enter can be used as a label in a graphical user interface, for example, or as a way to programmatically query the object.

Parameters:
description - The text description that you want to assign to the Screen object.
Examples:
Java:

String description = "First Session Instance";
screenObj.setDescription(description);


ASP (VBScript):

dim description
description = "First Session Instance"
Session("screenObj").setDescription description


C++:

CString description = "First Session Instance";
screenObj.setDescription(description);
See Also:
getDescription()

getDescription

public java.lang.String getDescription()
Returns a custom description for the Screen object, if a description was created previously using setDescription.

Returns:
The custom description created for the Screen object.
Examples:
Java:

String description = screenObj.getDescription();

ASP (VBScript):

dim description
description = Session("screenObj").getDescription


C++:

CString description = screenObj.getDescription();
See Also:
setDescription(java.lang.String)

addIScreenListener

public void addIScreenListener(java.util.EventListener inListener)
Adds the ScreenListener, which allows your application to receive various screen and/or status event notifications, to the Screen object. If the ScreenListener object implements the IScreenListener interface, it will receive screen events. If it implements the IStatusListener interface, it will receive status events. (For use with Java-based programming languages only; for COM-based languages, use addIScreenListenerEx.)

Parameters:
inListener - The screen/status listener to attach to the Screen object.
Example:
 screenObj = (ScreenType) sl.requestScreen(User,Password,WebView);
 if (screenObj != null)
 {
 screenObj.addIScreenListener(this);
    if (screenObj.Open())
    {
 	     ....//Todo: Place your code here
    }
 } 
See Also:
removeIScreenListener(java.util.EventListener)

removeIScreenListener

public void removeIScreenListener(java.util.EventListener inListener)
Removes the ScreenListener from the Screen object. The Screen object will no longer receive screen/status event notifications. (For use with Java-based programming languages only; for COM-based languages, use removeIScreenListenerEx.)

Parameters:
inListener - The screen/status listener to detach from the Screen object.
Example:
 if (screenObj != null)
 {
    screenObj.removeIScreenListener(this);
    screenObj.Close();
 } 
See Also:
addIScreenListener(java.util.EventListener)

getOIAText

public java.lang.String getOIAText()
Returns the text of the OIA portion (status line) of the presentation space in a string format.

Returns:
The text that appears in the status line.
Examples:
Java:

String OIA = screenObj.getOIAText();

ASP (VBScript):

dim OIA
OIA = Session("screenObj").getOIAText


C++:

CString OIA = screenObj.getOIAText();
See Also:
getOIAContents()

waitForCursor

public void waitForCursor(int inRow,
                          int inColumn,
                          int wtTime)
                   throws TimedOutException
Waits for the cursor to appear at the specified position, for a specified period of time. If inRow is zero, the wait completes when the cursor moves to the specified column. If inColumn is zero, the wait completes when the cursor moves to the specified row. Otherwise, it times out after wtTime (specified in milliseconds).

Specified by:
waitForCursor in interface com.attachmate.UPG.common.IScreen
Parameters:
inRow - The row in which the cursor must appear to satisfy the wait. When inRow is set to zero, the wait is satisfied when the cursor appears in the column specified, regardless of which row the cursor is in.
inColumn - The column in which the cursor must appear to satisfy the wait. When inColumn is set to zero, the wait is satisfied when the cursor appears in the row specified, regardless of which column the cursor is in.
wtTime - The number of milliseconds to wait for the wait condition to be satisfied before timing out.
Throws:
TimedOutException - Returned if WaitForCursor times out.
Examples:
Java:

 try
 {
      int inRow = 17;
      int inColumn = 20;
      int wtTime = 3000;
      m_screenObj.waitForCursor(inRow, inColumn, wtTime);
 }
    catch(TimedOutException e)
    {
        System.err.println("TimedOutException " );
        return;
    }

ASP (VBScript):

inRow = 0
inColumn = 0
wtTime = 5000

Session("screenObj").waitForCursor inRow,inColumn,wtTime


C++:

 TRY
 {
    int inRow = 17;
    int inColumn = 20;
    int wtTime = 3000;
    m_screenObj.waitForCursor(inRow, inColumn, wtTime);
 }
 CATCH_ALL(e)
 {
    AfxMessageBox ("TimedOutException " );
    return;
 }
 END_CATCH_ALL
See Also:
waitForString(java.lang.String, int, int, int), waitHostQuiet(int, int)

waitForString

public void waitForString(java.lang.String inText,
                          int inRow,
                          int inColumn,
                          int wtTime)
                   throws TimedOutException
Waits for the specified text to appear at the specified position, for a specified period of time. If the row and column are zero, it waits for text to appear anywhere in the presentation space. Otherwise, it times out after wtTime (specified in milliseconds).

Specified by:
waitForString in interface com.attachmate.UPG.common.IScreen
Parameters:
inText - The text string to wait for.
inRow - The row in which to look for the string. If the row is set to zero, the wait is satisfied if the string appears in the column specified, regardless of the row.
inColumn - The column in which to look for the string. If the column is set to zero, the wait is satisfied if the string appears in the row specified, regardless of the column.
wtTime - The number of milliseconds to wait for the wait condition to be satisfied before timing out.
Examples:
Java:

 try
 {
     // waitForString - Waits for the specified text to appear at the
     // specified position.

     String inText = "Ready";
     int inRow = 17;
     int inColumn = 20;
     int wtTime = 3000;

     m_screenObj.waitForString(inText, inRow, inColumn, wtTime);
 }
   catch(TimedOutException e)
   {
        System.err.println("TimedOutException " );
        return;
   }

ASP (VBScript):

inText = "LOGON"
inRow = 0
inColumn = 0
wtTime = 5000

Session("screenObj").waitForString inText,inRow,inColumn,wtTime


C++:

 TRY
 {
    CString inText = "UNIX";
    int inRow = 0;
    int inColumn = 0;
    int wtTime = 5000;
    m_screenObj.waitForString((LPCSTR)inText, inRow, inColumn, wtTime);
 }
 CATCH_ALL(e)
 {
    AfxMessageBox("TimedOutException " );
    return;
 }
 END_CATCH_ALL
Throws:
TimedOutException
See Also:
waitForCursor(int, int, int), waitHostQuiet(int, int)

waitHostQuiet

public void waitHostQuiet(int inSettleTime,
                          int wtTime)
                   throws TimedOutException
Waits for the host session to be idle for a specified period of time (in milliseconds). A session is considered to be "quiet" when there has been no activity in the host session for the specified amount of time. This is a synchronous call and does not return until the wait condition is satisfied. Otherwise, it times out after wtTime (specified in milliseconds). Note: Completion of this call does not indicate that data has been received from the host and/or that the presentation space has been updated. The user should check getKeyboardLocked. This is a quick indication of whether or not data has been received from the host.

Specified by:
waitHostQuiet in interface com.attachmate.UPG.common.IScreen
Parameters:
inSettleTime - The amount of time (in milliseconds), that the session needs to be idle before the wait condition is satisfied. The optimum settle time varies depending on the host application response time. For most host applications, a settle time of one to three seconds is sufficient.
wtTime - The number of milliseconds to wait for the wait condition to be satisfied before timing out.
Throws:
TimedOutException - Returned if WaitHostQuiet times out.
Examples:
Java:

 do
 { 
     try
     {
         // waitHostQuiet -

         int inSettleTime = 1000;
         int wtTime = 3000;

         m_screenObj.waitHostQuiet(inSettleTime, wtTime);
     }
     catch(TimedOutException e)
     {
         System.err.println("TimedOutException " );
         return;
     }
 } while (m_screenObj.getKeyboardLocked());
 

ASP (VBScript):

inSettleTime = 1000
wtTime = 3000

Session("screenObj").waitHostQuiet inSettleTime, wtTime


C++:

 int inSettleTime = 1000;
 int wtTime = 3000;
 TRY
 {
    this->m_screenObj.waitHostQuiet(inSettleTime, wtTime);
 }
 CATCH_ALL(e)
 {
    AfxMessageBox("TimedOutException " );
    return;
 }
 END_CATCH_ALL
See Also:
waitForCursor(int, int, int), waitForString(java.lang.String, int, int, int)

Attachmate Verastream SDK for UMC Reference Guide v4.0