public class REXXMigration extends Object implements ObjectCalling, ObjectMessages, NetPhantomConstants
The purpose of this class is to make the NetPhantom API available to REXX programs as similar as possible for Java programs that are ported from REXX. Using this class as a base class will allow only a minimal change of the code, mostly to change the REXX syntax to Java.
Also see the NetRexxMigration class.
A new instance of this object is created for each call to it. If a global instance
is required, use the VirtualSessionManager methods saveObject(String name,Object object)
,
Object getObject(String name)
and removeObject(String name)
.
To gain access to the central object instances, use the PhantomWorker getWorker()
as
a starting point. The PhantomWorker instance holds what is required to handle the client session and
the application data.
To get the instance of the control that issued the call, use VirtualInterface getVirtualInterface()
,
but be careful, it may return null
. The VirtualInterface is the common interface for all Controls
and Menu Items.
The return string to the called is set by a call to setReturnString(String s)
before
returning from the start(...)
method.
Parse Arg argId, argMsg, argStr if argMsg = 'HCHG' then do if HostGetFld('', 'mehr_dwn') = '+' then rc = PanSetCtlStyle('B_DOWN', 1) else rc = PanSetCtlStyle('B_DOWN', 0) end if argMsg = 'CMD' then do if HostGetFld('', 'Mehrfach') <> 'M' then do rc = HostSetFld('', 'AUSWAHL', '__') rc = HostSetFld('', 'FUNKTION', '__') Anz_Zeilen = PanListGetNum('LIST') do i = 1 to Anz_Zeilen rc = HostSetFld('', 'SEL', '__', i) end end rc = HostSetFld('', 'COMMAND', ' ') rc = HostSend('@8',,, 1) end Return 0
import se.entra.phantom.server.REXXMigration; public class B_DOWN extends REXXMigration { public void start(String argId, int argMsg, String argStr) { int rc; // The return code. if ( argMsg == HCHG ) { if ( HostGetFld("", "mehr_dwn").equals("+") ) rc = PanSetCtlStyle("B_DOWN", 1); else rc = PanSetCtlStyle("B_DOWN", 0); } if ( argMsg == CMD ) { if ( !HostGetFld("", "Mehrfach").equals("M") ) { rc = HostSetFld("", "AUSWAHL", "__"); rc = HostSetFld("", "FUNKTION", "__"); int Anz_Zeilen = PanListGetNum("LIST"); for ( int i = 1; i <= Anz_Zeilen; i++ ) rc = HostSetFld("", "SEL", "__", i); rc = HostSetFld("", "COMMAND", " "); rc = HostSend("@8", 0, 0, 1); } } } }
rc=my_external_function('param1',10)should be done in Java like:
my_external_function m_e_f = new my_external_function(); // Only needed once. m_e_f.setWorker(getWorker()); // Only needed once. int rc = m_e_f.aNewFunction("param1", 10);and the "my_external_function" class:
import se.entra.phantom.server.REXXMigration; public class my_external_function extends REXXMigration { public int aNewFunction(String p1, int i2) { // ...code... return 0; } }
| Name Comment | --------------- ------------------------------------------------------ | | HostSetScreen Used by PhantomProcessor in Phantom Hurricane 2.5 | HostSendPassword | | HostLockSession No terminal screen is used | HostDisable | | GetInput Used for Phantom Processor | | RxVarSave REXX variables are too tied to the REXX language | RxVarRestore | RxVarDelete |
String txt = PanGetCtlData("PAGE3/ENTRY1");This combined control reference can only be made from a program object, never from another control.
There are three special control IDs that are used to reference
different parts of the application:
*APP
, *PANEL
and *MENUITEM
.
The first two can be used to set and get the title bar text of the application area
or a panel. *MENUITEM
(where MENUITEM
is replaced by a
menu ID) references a menu item in the application menu. The IDs *MENUITEM
and *APP
can not be combined with a panel ID as there can only be one
application area.
Example: Get the title bar text of the panel "PAN1".
String txt = PanGetCtlData("PAN1/*PANEL");
Modifier and Type | Field and Description |
---|---|
static int |
CTLSTYLE_DISABLE
Value to disable a control.
|
static int |
CTLSTYLE_ENABLE
Value to enable a control.
|
static int |
CTLSTYLE_HIDE
Value to hide a control.
|
static int |
CTLSTYLE_READONLY
Value to set entryfield as READONLY when disabled.
|
static int |
CTLSTYLE_SHOW
Value to show a control.
|
static int |
MAX_TIMEOUT
Max timeout value.
|
static int |
REXX_ERR_FILENOTFOUND
File not found error.
|
static int |
REXX_ERR_GENERAL
General error.
|
static int |
REXX_ERR_HOSTFLDNOTFOUND
Host field not found error.
|
static int |
REXX_ERR_NOSTATE
Wrong or no state error.
|
static int |
REXX_ERR_NOTFOUND
Object not found error.
|
static int |
REXX_ERR_READERROR
File read error.
|
static int |
REXX_ERR_TIMEOUT
Timeout error.
|
CHAR, CHECK, CLK, CLOSE, CMD, CRT, DBLCLK, DEFOC, FOC, HCHG, HIDDEN, QMSG, RECRT, REM, SEL, SHOW, START, UCHG, XLATE
OBJACT_CHAR, OBJACT_CHECK, OBJACT_CLICK, OBJACT_CLOSE, OBJACT_COMMAND, OBJACT_CREATE, OBJACT_DBLCLICK, OBJACT_DDECONNECTION, OBJACT_DDEDATA, OBJACT_DDEERROR, OBJACT_DDEEXECUTE, OBJACT_DDEPOKE, OBJACT_DDEREQUEST, OBJACT_DDEVALIDATE, OBJACT_DEFOCUS, OBJACT_DESTROY, OBJACT_FOCUS, OBJACT_HIDDEN, OBJACT_HOSTCHANGE, OBJACT_LAST_MESSAGE_HANDLED, OBJACT_QUERYMSG, OBJACT_RECREATE, OBJACT_SELECT, OBJACT_SHOW, OBJACT_START, OBJACT_TRANSLATE, OBJACT_USERCHANGE, PHA_ICO_INFO, PHA_ICO_NOICON, PHA_ICO_QUESTION, PHA_ICO_STOP, PHA_ICO_WARNING, PHA_MSG_CANCEL, PHA_MSG_ENTER, PHA_MSG_ENTERCANCEL, PHA_MSG_OK, PHA_MSG_OKCANCEL, PHA_MSG_RETIGNCANCEL, PHA_MSG_RETRYCANCEL, PHA_MSG_YESNO, PHA_MSG_YESNOCANCEL
ACTION_CLOSEWINDOW, ACTION_CONTROL, ACTION_HOSTKEY, ACTION_MENU, ACTION_NONE, ACTION_NOTEBOOKPAGE, ACTION_POPUPMENU, CC_BACKGROUND, CC_BOTH, CC_FOREGROUND, CC_NONE, CLIPBOARD_GET, CLIPBOARD_SET, DATEF_DMY, DATEF_MDY, DATEF_SYSTEM, DATEF_YMD, DDE_ADVISE, DDE_EXECUTE, DDE_INITIATE, DDE_POKE, DDE_REQUEST, DDE_TERMINATE, DDE_UNADVISE, DDE_UPDATE, DDEVAR_DISABLE, DDEVAR_ENABLE, DDEVAR_REQUEST, DDEVAR_SET, DDEVAR_VALIDATE, EFT_AMOUNT, EFT_DATE, EFT_DATEAMOUNT, EFT_NORMAL, EFT_PASSWORD, EVENT_CHAR, EVENT_CHECK, EVENT_CLICK, EVENT_COMMAND, EVENT_DBLCLICK, EVENT_DDECONNECTION, EVENT_DDEDATA, EVENT_DDEERROR, EVENT_DDEEXECUTE, EVENT_DDEINVALIDATE, EVENT_DDEPOKE, EVENT_DDEREQUEST, EVENT_DEFOCUS, EVENT_FOCUS, EVENT_PAGEDOWN, EVENT_PAGEUP, EVENT_SELECT, EVENT_UNKNOWN, EVENT_USERCHANGE, EXTENDEDINFO_IDS_TO_CLIENT, FOCUSTYPE_CLIENTTARGET, FOCUSTYPE_CONTROL, FOCUSTYPE_NONE, ICON_CRITICAL, ICON_INFORMATION, ICON_NOICON, ICON_QUERY, ICON_WARNING, J_AUTO, J_BOTTOM, J_BOTTOMLEFT, J_BOTTOMRIGHT, J_CENTER, J_LEFT, J_RIGHT, J_TOP, J_TOPLEFT, J_TOPRIGHT, MAX_PANELS_PER_SESSION, MAX_SESSIONS, MB_ABORTRETRYIGNORE, MB_CANCEL, MB_ENTER, MB_ENTERCANCEL, MB_OK, MB_OKCANCEL, MB_RETRYCANCEL, MB_YESNO, MB_YESNOCANCEL, MBID_CANCEL, MBID_DEFAULT, MBID_ENTER, MBID_IGNORE, MBID_NO, MBID_OK, MBID_RETRY, MBID_YES, MS_MOVE, MS_NONE, MS_SIZE, NETPHANTOM_COPYRIGHT, NETPHANTOM_COPYRIGHT2, NETPHANTOM_VERSION, OBJEVENT_CHECK, OBJEVENT_CLICK, OBJEVENT_DBLCLICK, OBJEVENT_DEFOCUS, OBJEVENT_FOCUS, OBJEVENT_SELECT, OBJEVENT_USERCHANGE, PANELCREATE_APPPANEL, PANELCREATE_DANGLINGPANEL, PANELCREATE_DLGFRAME, PANELCREATE_EXTENDEDINFO, PANELCREATE_ICON, PANELCREATE_INDIVIDUALSIZE, PANELCREATE_POPUP, REPLYTYPE_CLIENTEXECUTE, REPLYTYPE_CLIPBOARD, REPLYTYPE_DDE, REPLYTYPE_FFONTLIST, REPLYTYPE_MESSAGEBOX, REPLYTYPE_REPORT, REPLYTYPE_SAVEPROPS, REPLYTYPE_TERMMARK, RPRT_CANCELPRINTJOB, RPRT_CLOSEPRINTJOB, RPRT_CONTPRINTJOB, RPRT_OPENPRINTJOB, RPRT_PRINTJOBCANCLD, RPRT_PRINTJOBCLOSED, RPRT_PRINTJOBCONT, RPRT_PRINTJOBOPENED, RPRT_PRINTJOBSTARTED, RPRT_STARTPRINTJOB, SELMODE_NORMAL, SELMODE_NOTALLOWED, SELMODE_REQUIRED, SELTYPE_MULTIPLE, SELTYPE_SINGLE, SEPARATOR, SEPARATORCHAR, TRANS_APPLICATIONCHANGE, TRANS_CALLOBJECT, TRANS_CANCELEXIT, TRANS_CLEARLOCK, TRANS_CLIENTEXECUTE, TRANS_CLIENTJARS, TRANS_CLIENTTEXTTABLE, TRANS_CLIENTUPDATED, TRANS_CLIENTUPDATEDNOLOCK, TRANS_CLIPBOARD, TRANS_CLIPBOARDCOMPONENT, TRANS_CLOSETERMINALWINDOW, TRANS_CONNECTIONREFUSED, TRANS_COUNTRYINFO, TRANS_CREATEPANEL, TRANS_CREATESESSION, TRANS_DDE, TRANS_DDEEVENT, TRANS_DDEEVENTREPLY, TRANS_DDEVAREVENT, TRANS_DISPLAYHELP, TRANS_DISPLAYTERMINAL, TRANS_DISPLAYTOOLTIPS, TRANS_ENDCONVERSATION, TRANS_EXIT, TRANS_FONTSUBSTITUTION, TRANS_HOSTCOLORTABLE, TRANS_HOSTPRINT, TRANS_HWND, TRANS_INACTIVESESSION, TRANS_INITIATE, TRANS_KEEPALIVE, TRANS_LOCALE, TRANS_LOGEVENT, TRANS_MESSAGEBOX, TRANS_MESSAGEBOXWITHREPLY, TRANS_MODALREPLY, TRANS_MULTTERM, TRANS_PING, TRANS_PRINTCOMPONENT, TRANS_PRINTPANEL, TRANS_PRINTREPORT, TRANS_PRTWINKEY, TRANS_RECONNECT, TRANS_REDIRECTION, TRANS_REMOVEPANELATLEVEL, TRANS_REMOVETERMINAL, TRANS_RENEGOTIATESSL, TRANS_REQUESTHELP, TRANS_RESOURCEURL, TRANS_SELECTSESSION, TRANS_SESSIONACTIVE, TRANS_SESSIONSELECTED, TRANS_SETCOLORS, TRANS_SETFOCUS, TRANS_SETLOCK, TRANS_SETPANELNESTLEVEL, TRANS_SETUPPARAMS, TRANS_SHOWDOCUMENT, TRANS_SOCKET, TRANS_SOUNDALARM, TRANS_STARTUPINFO, TRANS_STOPSESSION, TRANS_TERMINALDATA, TRANS_TERMINALUPDATE, TRANS_TERMINALWINDOW, TRANS_TERMWINTEXT, TRANS_UPDATEAPPLICATION, TRANS_UPDATEPANEL, TRANS_USEREXITPRTKEY, TRANSACTION_VERSION, TS_CLOSE, TS_DATA, TS_ERROR, TS_OPEN, VSIGN_MINUS, VSIGN_NONE, VSIGN_PLUSMINUS, YEARF_6DIG, YEARF_8DIG, YEARF_EXP8
Constructor and Description |
---|
REXXMigration()
No need for a constructor in the derived class.
|
Modifier and Type | Method and Description |
---|---|
protected String |
CallObject(String objectID,
String controlID,
int action,
String string)
Calls a NetPhantom object.
|
protected String |
CharIn(String stream,
long position,
int length)
CharIn returns a string of up to length characters read from the
character input stream name.
|
protected long |
CharOut(String streamname,
String data,
long position)
CharOut returns the count of characters remaining after attempting to write
string to the character output stream name.
|
protected long |
Chars(String streamname)
Chars returns the total number of characters remaining in the character input
stream name.
|
protected String |
ClientExecute(boolean async,
String command,
String data)
Performs a task on the client side.
|
protected String |
ClipbrdGet()
This method get the clipboard data from the client.
|
protected int |
ClipbrdSet(String data)
This method set the clipboard on the client.
|
protected int |
CompLine(int line,
String string)
This method compares a text string containing wildcards with a line on the
host screen.
|
protected int |
CompPos(int line,
int column,
String string)
This method compares a text string without wildcards with a certain position
(line and column) on the host screen.
|
protected int |
CompScreen(String string)
This method compares a text string containing wildcards with the entire host
screen.
|
protected String |
CreateTempFile()
Creates a temporary file in the directory of
the current runtime file and adds it for removal
when the client session is disposed of.
|
protected String |
Date(String form)
Return a formatted current date.
|
protected int |
DdeExecute(int dde_nn,
String command)
This function sends the DDE verb EXECUTE to the application and the
subject that is initiated to dde_nn.
|
protected int |
DdeInitiate(String programName,
String subject)
This function requests communication with the program ProgramName with the
subject Subject.
|
protected int |
DdePoke(int dde_nn,
String location,
String data)
This function sends the DDE verb POKE to the application and subject
which is initiated to dde_nn.
|
protected int |
DdeTerminate(int dde_nn)
This function exits communication with the DDE session dde_nn.
|
protected int |
DeleteFile(String fileName)
Deletes a file.
|
protected String |
ExecuteProcess(String dir,
boolean useRuntimeDir,
String cmdLine)
Executes a Process, waiting for the response code and
reading the STDOUT/STDERR output streams.
|
protected int |
FileAppend(String fileName,
String data)
Adds the line data to the end of the file with the name fileName.
|
protected int |
FileCreate(String fileName)
Creates an empty file with the name fileName.
|
protected String |
FileSpec(String opt,
String path)
FileSpec returns a selected element of filespec, a given file specification,
identified by one of the following strings for option:
|
CodepageConverter |
getCodepageConverter()
Gets the CodepageConverter that is appropriate for writing files with this runtime.
|
protected PhantomHostField |
getHostFieldFromID(String screenName,
String fieldName)
Internal method to get host field from current host screen or specified host screen
or return null if not exist.
|
protected PhantomHostScreen |
getHostScreenFromID(String screenName)
Internal method to get NetPhantom host screen from current host screen or specified host screen name
or return null if not exist.
|
String |
getReturnString()
Gets the return string for the object.
|
protected VirtualInterface |
getVirtualComponentFromID(String compID)
Get control, menu item or special information.
|
VirtualInterface |
getVirtualInterface()
Method to get the virtual interface to the calling object.
|
PhantomWorker |
getWorker()
Method to get the interface to the PhantomWorker class.
|
protected int |
GlobVarDelete(String varName)
Deletes a NetPhantom global variable.
|
protected String |
GlobVarGet(String varName)
Gets a global variable.
|
protected int |
GlobVarSet(String varName,
String data)
Sets a NetPhantom global variable.
|
protected int |
HostConnect(String sessionID)
Starts communication with a host session.
|
protected int |
HostDisconnect()
Disconnects communication with current host session.
|
protected int |
HostError()
Checks for errors in in contact with the host session.
|
protected int |
HostGetCol()
Returns the current column location of the cursor in the session
(1-80 or the maximum size of the screen at the time).
|
protected String |
HostGetCurrFld()
Gets the current host field of the current screen (to get the current screen use HostGetScreen).
|
protected String |
HostGetFld(String screenName,
String fieldName,
int lineNo)
Retrieves the contents of a host field.
|
protected String |
HostGetFldAttr(String screenName,
String fieldName,
int lineNo)
Retrieves the attribute of a host field.
|
protected int |
HostGetFldClr(String screenName,
String fieldName,
int lineNo)
Retrieves the color of a host field.
|
protected int |
HostGetFldLen(String screenName,
String fieldName,
int lineNo)
Returns the length of the host field FieldName or 0 if not found.
|
protected String |
HostGetLastErr(int clear)
Retrieves the last host error message for 5250.
|
protected String |
HostGetLine(int lineNo)
Returns a line from the host screen.
|
protected int |
HostGetRow()
Returns the current row of the cursor in the session.
|
protected String |
HostGetScreen()
Returns the current matching screen or empty string if none.
|
protected String |
HostGetSession()
Returns the current host session's ID (A-Z)
|
protected String |
HostGetString(int line,
int column,
int length)
Returns a string from the host screen.
|
protected int |
HostGetTimeout()
Returns the current time-out value in seconds (0-998 seconds, 999=no time-out).
|
protected int |
HostHideSession(int hide)
This method hides or shows the terminal emulator window.
|
protected int |
HostSend(String string,
int startTimer,
int stopTimer,
int newMsg)
Sends a series of keystrokes to the host and waits for the lock state to disapear.
|
protected int |
HostSendDirect(String string,
int newMsg)
Sends a series of keystrokes to the host.
|
protected int |
HostSendFilePsw(String userID)
Sends a password to the host which is then stored on disk in encrypted form.
|
protected int |
HostSetCursor(int line,
int column)
Sets the cursor position.
|
protected int |
HostSetCursorToFld(String fieldName,
int lineOffset)
Sets the cursor position to the beginning of a host field with a line offset.
|
protected int |
HostSetFld(String screenName,
String fieldName,
String data,
int lineNo)
Sets a host field with text.
|
protected int |
HostSetTimeout(int timeoutValue)
Sets the time-out value used in waiting and comparison functions.
|
protected int |
HostWait(int numWait)
Waits for the "wait" state of the session to disappear.
|
protected int |
HostWaitScreen()
Waits for any screen change, e.g.
|
protected String |
LineIn(String streamname,
long pos,
long count)
LineIn returns count (0 or 1) lines read from the character input stream name.
|
protected int |
LineOut(String streamname,
String data,
long line)
LineOut returns the count of lines remaining after attempting to
write string to the character output stream name.
|
protected int |
Lines(String streamname)
Lines returns 1 if any data remains between the current read position
and the end of the character input stream name, and returns 0 if no
data remains.
|
protected boolean |
LogMsg(String msg)
Send log entry to direct logger.
|
protected int |
LogonGet()
Reads the logon state of the currently initiated session.
|
protected int |
LogonSet(int logonFlag)
Sets the logon state of the currently initiated session.
|
protected String |
MacroPlay(String macroName,
String[] arguments)
This function plays back a macro.
|
protected int |
Message(int type,
int icon,
String message)
Requests and displays a message to the user.
|
protected int |
PanCallCtl(String controlID)
Activates a menu item or a push button with control ID
controlID . |
protected String |
PanChart(String controlID,
String function,
String data)
Function for processing graphical charts.
|
protected int |
PanCheckGet(String controlID)
Retrieves the selection of a radio button or check box.
|
protected int |
PanCheckSet(String controlID,
int checkState)
Sets the selection of a radio button or check box.
|
protected int |
PanComboFromFile(String controlID,
String fileName)
Fills a combination box with contents of a text file.
|
protected int |
PanCreate(String panelID)
Creates a new panel.
|
protected int |
PanDestroy()
Removes or destroys the topmost panel.
|
protected int |
PanelExit()
Exits the current client session.
|
protected boolean |
PanEnableClientProcessing(boolean on)
Enabled or disables all client processing.
|
protected int |
PanEnd(String string)
Exits a PanProcess function issued from another thread with string.
|
protected String |
PanFormatText(String text)
Parses string to resolve @-sequences.
|
protected String |
PanGetCtlData(String controlID)
Retrieves the contents of a panel control.
|
protected int |
PanGetCtlLen(String controlID)
Get the length of a panel control.
|
protected String |
PanGetCtlProperty(String controlID,
String property)
Retrieves a property of a panel control.
|
protected int |
PanGetCtlStyle(String controlID)
Retrieves a control style.
|
protected String |
PanGetCurrNbPage(String controlID)
Get the current notebook page.
|
protected String |
PanGetCurrPanel()
Retrieves the name of the current panel.
|
protected String |
PanGetDllExt(String name)
Get a system dependent extension of a file name.
|
protected String |
PanGetFocus()
Get the current panel/control that has focus or empty string
if focus not could be found.
|
protected String |
PanGetText(String textID)
Retrieves a text from the current text file.
|
protected int |
PanHostInhibit(int inhibitState)
Removes or restores panel processing between NetPhantom and the terminal session.
|
protected boolean |
PanIsClientProcessingEnabled()
Checks if client processing is enabled.
|
protected int |
PanListClear(String controlID)
Clears a list of all its contents.
|
protected int |
PanListDelete(String controlID,
int line)
Deletes a line (1-nn) from a list.
|
protected int |
PanListFromFile(String controlID,
String fileName)
Fills a list with data from a text file.
|
protected String |
PanListGetData(String controlID,
int lineNo)
Retrieves the contents of a line (1-nn) in a list.
|
protected String |
PanListGetFld(String controlID,
int lineNo,
int columnNo)
Function to retrieve a list field (a line [1-nn] and a column [1-columnCount]).
|
protected int |
PanListGetNum(String controlID)
Get number of lines in a list.
|
protected int |
PanListGetSel(String controlID,
int prevLine)
Retrieves the next selected line in a list or zero if no more selections exists.
|
protected int |
PanListInsertData(String controlID,
int line,
String data)
Adds or inserts a line of Data in a list.
|
protected int |
PanListSetData(String controlID,
int lineNo,
String data)
Update a line in a list.
|
protected int |
PanListSetFld(String controlID,
int lineNo,
int columnNo,
String data)
Function to set a list field (a line [1-nn] and a column [1-columnCount]).
|
protected int |
PanListSetSel(String controlID,
int line,
int selectionState)
Selects or deselects a line in a list.
|
protected int |
PanListToFile(String controlID,
String fileName)
Stores the contents of a list into a text file.
|
protected int |
PanLock(int lockState)
Locks or restores user panel processing.
|
protected int |
PanNbCancelPaging()
Cancels notebook paging when a user has selected a notebook page that is not the Next or the Previous one.
|
protected int |
PanPreload(String panelID)
Preloads a panel the same way as when next panel is connected to a push button or a menu item.
|
protected String |
PanProcess()
Starts processing a panel.
|
protected int |
PanRemove()
Removes or destroys the topmost panel.
|
protected int |
PanSelectCurrCtl()
This function selects the current entry field.
|
protected int |
PanSetCtlClr(String controlID,
int foreground,
int background)
This function set or removes the colors of a control.
|
protected int |
PanSetCtlData(String controlID,
String data)
Sets the contents of a panel control.
|
protected int |
PanSetCtlLen(String controlID,
int length)
Set the length of a panel control.
|
protected int |
PanSetCtlProperty(String controlID,
String property,
String data)
Sets a property of a panel control.
|
protected int |
PanSetCtlStyle(String controlID,
int style)
Sets style of panel control.
|
protected int |
PanSetCurFromHost()
Places the cursor in the panel in the same position it has in the terminal session.
|
protected int |
PanSetFocus(String controlID,
int selectControl)
Sets focus to a panel control.
|
protected int |
PanSetPanelFromHost(String[] panels)
Sets the correct panel from the current cursor position.
|
protected boolean |
PanSetRatioAndFontScaling(int ratioX,
int ratioY,
boolean doScaleFonts)
Sets the ratioX and ratioY parameters and if the fonts should
be scaled with these ratio parameters also.
|
protected int |
PanSetTextFile(String fileName)
Swaps the current text file for the specified file name.
|
protected int |
PanSetXlateFile(String fileName)
Swaps the current translation file for the specified file name.
|
protected int |
PanUpdate()
Updates all controls and menus in the panel in respect to text and translation files and the current host screen.
|
protected String |
PanXlate(String text)
Translates the string using the current translation table.
|
protected int |
RemoveTempFile(String fileName)
Removes a temporary file name from the client session.
|
protected String |
Report(String com,
String p1,
String p2,
String p3,
String p4,
String p5)
Handles the printing of a report.
|
protected boolean |
RotateLog()
Rotate the log file (if configured to rotate on log file size).
|
protected int |
ScrComp(String screenName)
Compares the host screen with screen name without waiting.
|
protected String |
ScrGetNext()
Retrieves the name of the next matching screen identity after ScrMatch.
|
protected int |
ScrMatch()
Matches the screen with all the screen identities.
|
protected int |
ScrMultiWait(String[] screenNames)
Waits until the screen matches one of the specified screen identities.
|
protected String |
ScrMultiWait2(String[] screenNames)
Waits until the screen matches one of the specified screen identities.
|
protected int |
ScrWait(String screenName)
Waits until the screen matches the screen identity.
|
protected String |
SendEmail(String com,
String p1)
Handles the mail functionality.
|
protected String |
SendSMS(String command,
String param1,
String param2)
Handles the sms functionality.
|
protected int |
SessionExit()
Exits the current client session.
|
protected String |
SessionGet()
Retrieves the session that is in the foreground.
|
protected String |
SessionGetAll()
Retrieves all the sessions that have been started.
|
protected int |
SessionSelect(String sessionID)
Places the session in the foreground of all panel sessions.
|
protected int |
SessionStart(String sessionID)
Starts a new main panel session for an application panel.
|
protected int |
SessionStop(String sessionID)
Stops a panel session.
|
protected int |
SessVarDelete(String varName)
Deletes a session variable.
|
protected String |
SessVarGet(String varName)
Gets a session variable.
|
protected int |
SessVarSet(String varName,
String data)
Sets a session variable.
|
void |
setReturnString(String s)
Sets the return string for the object.
|
void |
setVirtualInterface(VirtualInterface vI)
Method to set the virtual interface to the calling object.
|
void |
setWorker(PhantomWorker p)
Method to setup the interface to the PhantomWorker class.
|
protected int |
ShowDocument(String url,
String target)
Show HTML document from applet.
|
void |
start(String argId,
int argMsg,
String argStr)
This is the function that starts the Java object.
|
protected boolean |
StartLog()
Set direct logging active.
|
protected boolean |
StopLog()
Set direct logging inactive.
|
protected String |
Stream(String streamname,
String operation,
String command)
Stream returns a string describing the state of, or the result of an operation
upon, the character stream name.
|
protected String |
Time(String form)
Return a formatted current time.
|
protected String |
TimerGet(int timerNo)
Returns the current reading on a timer (1-9) in hundredth of seconds.
|
protected int |
TimerPause(int timerNo)
Pauses a timer (1-9).
|
protected int |
TimerStart(int timerNo)
Starts a timer (1-9).
|
protected int |
TimerStop(int timerNo)
Stops a timer (1-9).
|
protected int |
Wait(int seconds)
Waits for the number of seconds specified.
|
protected int |
WCompLine(int line,
String string,
int timer)
This method compares a text string containing wildcards with a line on the
host screen.
|
protected int |
WCompPos(int line,
int column,
String string,
int timer)
This method compares a text string without wildcards with a certain position
(line and column) on the host screen.
|
protected int |
WCompScreen(String string,
int timer)
This method compares a text string containing wildcards with the entire host
screen.
|
protected int |
XDdeAdvise(int hConv,
String item,
int flags)
This function submits a request to the DDE Engine to have the application that
serves the conversation identified by hConv send the data connected to Item every
time it changes.
|
protected int |
XDdeExecute(int hConv,
String command)
This function submits a request to the DDE Engine to have the application that serves
the conversation identified by hConv execute the Command.
|
protected int |
XDdeInitiate(String progName,
String topicName,
String objectName)
This functions initiates the requested DDE conversation.
|
protected int |
XDdePoke(int hConv,
String item,
String data)
This functions submits a request to the DDE Engine to poke the unsolicited Data
to the Item in the conversation identified by hConv.
|
protected int |
XDdeRequest(int hConv,
String item)
This function submits a request to the DDE Engine to have the application
that serves the conversation identified by hConv send the data connected to
Item.
|
protected int |
XDdeTerminate(int hConv)
This functions submits a request to the DDE Engine to terminate the DDE
conversation identified by hConv.
|
protected int |
XDdeUnadvise(int hConv,
int hReq)
This function submits a request to the DDE Engine to have the application
that serves the conversation identified by hConv terminate the advise link
identified by hReq.
|
protected int |
XDdeUpdate(String topic,
String item,
String data)
This functions notifies the DDE Engine that the data for Topic, item has
changed to Data.
|
public static final int MAX_TIMEOUT
public static final int CTLSTYLE_DISABLE
public static final int CTLSTYLE_ENABLE
public static final int CTLSTYLE_HIDE
public static final int CTLSTYLE_SHOW
public static final int CTLSTYLE_READONLY
public static final int REXX_ERR_GENERAL
public static final int REXX_ERR_TIMEOUT
public static final int REXX_ERR_NOSTATE
public static final int REXX_ERR_FILENOTFOUND
public static final int REXX_ERR_READERROR
public static final int REXX_ERR_HOSTFLDNOTFOUND
public static final int REXX_ERR_NOTFOUND
public REXXMigration()
public void setWorker(PhantomWorker p)
setWorker
in interface ObjectCalling
public PhantomWorker getWorker()
getWorker
in interface ObjectCalling
public void setVirtualInterface(VirtualInterface vI)
setVirtualInterface
in interface ObjectCalling
public VirtualInterface getVirtualInterface()
getVirtualInterface
in interface ObjectCalling
public void setReturnString(String s)
setReturnString
in interface ObjectCalling
public String getReturnString()
getReturnString
in interface ObjectCalling
public void start(String argId, int argMsg, String argStr)
Every derived Java class should override this method.
Valid messages are CRT, REM, UCHG, HCHG, FOC, DEFOC, CLK, DBLCLK, CMD, SEL, CLOSE, CHAR, CHECK, HIDDEN, RECRT, XLATE, START, SHOW, QMSG, DDEPOKE, DDEEXEC, DDEREQ, DDEVAL, DDECONN, DDEERR and DDEDATA).
start
in interface ObjectCalling
protected int HostConnect(String sessionID) throws IllegalArgumentException
The ID of the host session is a letter from A to Z or "." to diconnect from all sessions. This is the letter that is specified in the configuration in terminal emulation software. Check this ID in terminal profiles/sessions in server.ini file.
If that session is already connected, the call to the function will be ignored. Otherwise contact with any session is canceled to change to the session requested.
Returns:
0 = No error. 1 = Unable to establish contact with the host session.
IllegalArgumentException
HostDisconnect()
,
HostGetSession()
protected int HostDisconnect()
Returns: Always zero.
HostConnect(java.lang.String)
,
HostGetSession()
protected String HostGetSession()
Returns:
'A' to 'Z' if connected to host session. space ' ' or period '.' if disconnected from all host sessions.
HostConnect(java.lang.String)
,
HostDisconnect()
protected int HostError()
Returns:
0 = No error. 1 = Communication error with host.
protected int HostSetTimeout(int timeoutValue) throws IllegalArgumentException
protected int HostGetTimeout()
protected int HostGetRow()
HostGetCol()
protected int HostGetCol()
Return Value:
0 Unable to retrieve position. 1-nn Row number.
HostGetRow()
,
HostSetCursor(int, int)
protected int HostSetCursor(int line, int column) throws IllegalArgumentException
Parameters:
line Cursor line (1-nn). column Cursor column (1-nn).Return Value:
0 No error. 1 Unable to set cursor position.
IllegalArgumentException
HostGetCol()
,
HostGetRow()
protected int HostWait(int numWait) throws IllegalArgumentException
This function cannot be used with Java macros.
IllegalArgumentException
HostWaitScreen()
protected int HostWaitScreen()
HostWait(int)
protected int HostSend(String string, int startTimer, int stopTimer, int newMsg) throws IllegalArgumentException
Parameters:
string String of characters and Key codes that will be send to the host. start_timer Timer (1-9, 0 = no timer) that will be started when calling this function. stop_timer Timer (1-9, 0 = no timer) that will be stopped when the wait state disappears from the host. newMsg The flag NewMsg is set if the application is to set the cursor position from host in the graphical panel and message boxes of the type "New message after send key" are to be checked.Returns:
0 No error. 1 Communication error with host. 2 Time-out.
IllegalArgumentException
HostSendDirect(java.lang.String, int)
,
HostWait(int)
protected int HostSendDirect(String string, int newMsg) throws IllegalArgumentException
HostSend
, this function does not wait for the session's
wait state to disappear. Keystrokes may include special or sending keys (e.g. Enter, F3, etc.).
Parameters:
string String of characters and Key codes that will be send to the host. newMsg The flag NewMsg is set if the application is to set the cursor position from host in the graphical panel and message boxes of the type "New message after send key" are to be checked.Returns:
0 No error. 1 Communication error with host.
IllegalArgumentException
HostSend(java.lang.String, int, int, int)
protected int HostSendFilePsw(String userID) throws IllegalArgumentException
Parameter
userID User ID file name created by NetPhantom Editor containing password.Returns:
0 No error. 1 Communication error with host. 2 Time-out.
IllegalArgumentException
HostSend(java.lang.String, int, int, int)
,
HostWait(int)
protected String HostGetLine(int lineNo) throws IllegalArgumentException
IllegalArgumentException
HostGetFld(java.lang.String, java.lang.String, int)
protected String HostGetString(int line, int column, int length) throws IllegalArgumentException
Parameters:
line Line in host (1-nn). column Column in host (1-nn). length Length of string.Comments:
Note that the string must all be located on one line (i.e. no wrap).
protected int HostSetFld(String screenName, String fieldName, String data, int lineNo) throws IllegalArgumentException
Parameters:
screenName Name of host screen (can be empty or null for current screen). fieldName Name of host field. data String to set field with. lineNo Line number in host field (for multiple line host fields, zero otherwise).Returns:
0 No error. 1 General error. 9 Field not found.Comments:
Fills the field fieldName for the screen identity screenName with the data. A line number can be specified if the field is a list box (connected to a panel field of the list type), in which case enter the line number (1=first line, etc.). If the screen name is empty or null the current matching screen is assumed.
IllegalArgumentException
HostGetFld(java.lang.String, java.lang.String, int)
protected String HostGetFld(String screenName, String fieldName, int lineNo) throws IllegalArgumentException
Parameters:
screenName Name of host screen (empty or null is current screen). fieldName Name of host field. lineNo Used when a host field consists of more than one row.Returns field contents or empty string if the field data could not be retrieved.
protected int HostGetFldClr(String screenName, String fieldName, int lineNo) throws IllegalArgumentException
Parameters:
screenName Name of host screen (if name is empty or null, the current screen is assumed). fieldName Name of host field. lineNo Used when a host field consists of more than one row.Comments:
Retrieves the color of the field fieldName for the screen identity screenName. A line number can be specified if the field is a list box (connected to a panel control of the list type), in which case enter the line number (1=first line, etc.). If the screen name is empty, the current matching screen is assumed.
The color of the field is from 0 to 255. Both foreground and background colors are retrieved. For a list of colors see Appendix H Host Field Colors.
IllegalArgumentException
protected String HostGetScreen()
protected String HostGetLastErr(int clear) throws IllegalArgumentException
Setting the clear flag will clear the error message.
Returns last error message as a string or empty string if no error message exists.
IllegalArgumentException
protected String HostGetFldAttr(String screenName, String fieldName, int lineNo) throws IllegalArgumentException
Parameters:
screenName Name of host screen (empty is current screen). fieldName Name of host field. lineNo Used when a host field consists of more than one row.The attribute of a field is Protected, Hidden or both.
Return values:
Returns field attribute as a two character string. First character "P" = protected or " " (space) = not protected. Second character "H" = Hidden or " " (space) = not hidden.
1 Unable to retrieve field attribute. 9 Field not found.
IllegalArgumentException
protected int HostGetFldLen(String screenName, String fieldName, int lineNo) throws IllegalArgumentException
Parameters:
screenName Name of any host screen. Empty is current screen. fieldName Name of host field. lineNo An optional line number for multiple line fields.
IllegalArgumentException
HostGetFld(java.lang.String, java.lang.String, int)
protected String HostGetCurrFld()
It will return a string consisting of the current field name and line number, or it will return an empty string.
protected int HostSetCursorToFld(String fieldName, int lineOffset) throws IllegalArgumentException
Parameters:
fieldName Name of host field. lineOffset The line number to which the cursor should be set (1-nn).Returns:
0 No error. 1 General error. 9 Field not found.
IllegalArgumentException
HostGetCurrFld()
,
HostSetCursor(int, int)
protected int HostHideSession(int hide) throws IllegalArgumentException
Parameters:
hide Set to 0 (zero) if the terminal window should be displayed or 1 if it should be hidden.Returns:
0 No error. 1 Unable to hide/show window.
IllegalArgumentException
protected String MacroPlay(String macroName, String[] arguments)
If the macro has a number of parameters these should be specified. The number may vary from none to a maximum of ten. The macro works with the current time-out setting for waiting for screens. Naturally, this can be reset from the macro.
If time-out is reached (return Value 2), find the screen in which the macro is located and continue working from this screen.
The maximum length of each parameter is 80 characters.
This function should only be used from Java applications if screens switches exist in the macro. If the macro only fills the current screen with information, a Java macro may be used. Recommendation: use REXX application.
Return values:
0 No error. 1 Unable to retrieve field attribute. 2 Time-out. 9 Macro not found. other Any Java programs called up from within the macro may return other values or strings.
protected int ScrComp(String screenName) throws IllegalArgumentException
Return values:
0 Screen matches. 1 General error. 2 Time-out. 4 No match.
IllegalArgumentException
ScrWait(java.lang.String)
,
ScrMultiWait(java.lang.String[])
protected int ScrWait(String screenName) throws IllegalArgumentException
The maximum waiting period is the current time-out.
Return values:
0 Screen found. 1 General error. 2 Time-out.
IllegalArgumentException
ScrComp(java.lang.String)
,
ScrMultiWait(java.lang.String[])
protected int ScrMultiWait(String[] screenNames) throws IllegalArgumentException
The maximum waiting period is the current time-out. At least one screen name must be specified.
Return values:
0 One of the screens found. 1 General error. 2 Time-out.
IllegalArgumentException
ScrMatch()
,
ScrWait(java.lang.String)
,
ScrComp(java.lang.String)
,
HostWait(int)
protected String ScrMultiWait2(String[] screenNames)
The maximum waiting period is the current time-out. At least one screen name must be specified.
Return values:
ScreenName One of the screens found. 1 General error. 2 Time-out.
IllegalArgumentException
ScrMatch()
,
ScrWait(java.lang.String)
,
ScrComp(java.lang.String)
,
HostWait(int)
protected int ScrMatch()
The return value specifies a number of screens that match. Then use the function ScrGetNext to find the name of the screens.
ScrGetNext()
protected String ScrGetNext()
Returns empty string if no more screens matches.
ScrMatch()
protected int PanCreate(String panelID) throws IllegalArgumentException
Return value:
0 OK. 1 Error.
IllegalArgumentException
PanDestroy()
,
PanPreload(java.lang.String)
protected int PanPreload(String panelID) throws IllegalArgumentException
rc = PanPreload("*");
can be specified. It can also be used to turn notebook
pages, i.e. to specify the notebook page ID.
Return value:
0 OK. 1 Error.
IllegalArgumentException
PanCreate(java.lang.String)
,
PanDestroy()
protected String PanProcess()
The function does not return until the function PanEnd has been called with a certain string or the panel itself is closed by the user, leading to the application being terminated.
This function can only be used from a REXX application.
Return value:
String String sent to the function PanEnd CLOSE This string is returned when NetPhantom is en route to being exited.
PanEnd(java.lang.String)
protected int PanEnd(String string)
PanEnd signals an event for a REXX application waiting on PanProcess. PanProcess will wait until it receives the string from PanEnd after which the application will continue using the contents of that string. Normally it is a REXX application that issues PanProcess and a Java macro that calls PanEnd.
Return value:
0 OK. 1 Error.
PanProcess()
protected int PanDestroy()
Note: a main panel cannot be destroyed.
Return value:
0 OK. 1 Error.
protected int PanRemove()
PanDestroy()
protected int PanHostInhibit(int inhibitState) throws IllegalArgumentException
Return value:
0 OK. 1 Error.Example:
PanHostInhibit(1); PanLock(1); int rc = HostSend("@E"); rc = HostWait(); String fldname = HostGetFld(null,"FLDNAME"); rc = HostSend("@3"); rc = HostWait(); PanHostInhibit(0); PanLock(0);
IllegalArgumentException
PanLock(int)
protected int PanLock(int lockState) throws IllegalArgumentException
Return value:
0 OK. 1 Error.
Example:
Remove host and user processing, execute code and then restore all.
PanHostInhibit(1); // Must be first! PanLock(1); ...code... PanHostInhibit(0); PanLock(0);
IllegalArgumentException
PanHostInhibit(int)
protected int PanSetCtlData(String controlID, String data) throws IllegalArgumentException
If ControlID is *PANEL
the text for the current panel is set.
If it is *APP
the text for the application panel is set.
This function can also be used for image handling. See Chapter 6 Image Handling in the Developers Reference.
Return value:
0 OK. 1 Error. 9 Error, control not found.
IllegalArgumentException
PanGetCtlData(java.lang.String)
protected String PanGetCtlData(String controlID) throws IllegalArgumentException
If ControlID is *PANEL
, the text for the current panel is
retrieved. If it is *APP
the text for the application panel is retrieved.
This function can also be used for image handling. See Chapter 6 Image Handling in the Developers Reference.
IllegalArgumentException
PanSetCtlData(java.lang.String, java.lang.String)
protected int PanSetCtlStyle(String controlID, int style) throws IllegalArgumentException
This also works on the panel's menu items. If an asterisk (*) is typed before the control ID, the application panel's menu item with this ID will be processed instead.
style:
0 Disable the control. 1 Enable the control. 2 Hide the control (this does not work for menus). 3 Show the control (this does not work for menus).Return value:
0 OK. 1 Error. 9 Error, control not found.
IllegalArgumentException
PanGetCtlStyle(java.lang.String)
protected int PanGetCtlStyle(String controlID) throws IllegalArgumentException
This also works on the panel's menu items. If an asterisk (*) is typed before the control ID, the application panel's menu item with this ID will be processed instead.
Return value:
0 Control disabled. 1 Control enabled. 9 Error, control not found.
IllegalArgumentException
PanSetCtlStyle(java.lang.String, int)
protected int PanSetCtlClr(String controlID, int foreground, int background) throws IllegalArgumentException
Set the color to 0=no change, 127=restore to normal or 1-30.
The color can be the foreground and/or the background color. If foreground or background is set to 0 (zero), that color will be left as it was previously, e.g. will not be set. To remove one or both of the colors, e.g. to restore the color to default, set it to 127.
For the list of colors for the controls see Appendix G Graphical Control Colors in the Developers Reference.
Return value:
0 OK. 1 Error. 9 Error, control not found.
IllegalArgumentException
protected int PanListInsertData(String controlID, int line, String data) throws IllegalArgumentException
The line will be inserted before the line. If lines should be added at the end of the list set line to 0. If the list contains several columns these should be separated using the Tab character (ASCII value 9).
If a list column has foreground or background color attributes, the column data must be preceded by two characters, foreground and background color index, respectively. See Appendix G Graphical Control Colors in the Developers Reference.
This function can also be used with combination boxes.
Return value:
0 OK. 1 Error. 9 Error, control not found.
protected int PanListDelete(String controlID, int line) throws IllegalArgumentException
This function can also be used with combination boxes.
Return value:
nn Number of lines remaining in the list box or combination box.
protected int PanListClear(String controlID) throws IllegalArgumentException
This function can also be used with combination boxes.
Return value:
0 OK. 1 Error. 9 Error, control not found.
protected int PanListSetSel(String controlID, int line, int selectionState) throws IllegalArgumentException
The range for line is 1 up to the number of lines in the list (inclusive). If Line is set to 0 (zero), the last line will be selected.
This function can also be used with combination boxes.
Return value:
0 OK. 1 Error. 9 Error, control not found.
IllegalArgumentException
PanListGetSel(java.lang.String, int)
protected int PanListGetSel(String controlID, int prevLine) throws IllegalArgumentException
The list search is based on prevLine. If this is 0 the search starts from the first line. If it is greater than 0, the search is started on the line following the prevLine specified.
This function can also be used with combination boxes.
IllegalArgumentException
PanListSetSel(java.lang.String, int, int)
protected String PanListGetData(String controlID, int lineNo) throws IllegalArgumentException
If the list contains several columns the returned string will contain the Tab character (ASCII value 9) between each column.
If a list column has foreground or background color attributes, the column data is preceded by two characters, i.e. the foreground and background color index, respectively. See Appendix G Graphical Control Colors in the Developers Reference.
This function can also be used with combination boxes.
protected int PanListFromFile(String controlID, String fileName) throws IllegalArgumentException
Each line in the file will therefore form a line in the list. The list will not be cleared before the file data is added to the end of the list. If the list contains several columns, the lines in the file should contain the Tab character (ASCII value 9) between each column.
If a list column has foreground or background color attributes, the column data must be preceded by two characters, i.e. the foreground and background color index, respectively. See Appendix G Graphical Control Colors in the Developers Reference.
This function can also be used with combination boxes.
Return value:
0 OK. 1 Error. 5 Error, file not found. 6 Error, read error. 9 Error, control not found.
protected int PanListToFile(String controlID, String fileName) throws IllegalArgumentException
Each line in the list will therefore form a line in the file. If the file already exists, it will be replaced. It will be written in OEM ASCII text character set. If the list contains several columns, the lines in the file contain the tab character (ASCII value 9) between each column.
If a list column has foreground and background color attributes, the column data will be preceded by two characters, i.e. the foreground and background color index, respectively. See Appendix G Graphical Control Colors in the Developers Reference.
This function can also be used with combination boxes.
Return value:
0 OK. 1 Error. 9 Error, control not found.
protected String PanListGetFld(String controlID, int lineNo, int columnNo) throws IllegalArgumentException
This is a function that is used to retrieve a field (line and column) from a list without having to search for the tab characters to find the column.
protected int PanListSetFld(String controlID, int lineNo, int columnNo, String data) throws IllegalArgumentException
This function can be used instead of PanListSetData when one column in a list should be updated.
If a list column has foreground or background color attributes, the column data must be preceded by two characters, foreground and background color index, respectively. See Appendix G Graphical Control Colors in the Developers Reference.
Return value:
0 OK. 1 Error. 9 Error, control not found.
protected int PanListSetData(String controlID, int lineNo, String data) throws IllegalArgumentException
This function should be used for lists with one column, or when all columns in a line should be updated, otherwise use PanListSetFld.
If a list column has foreground or background color attributes, the column data must be preceded by two characters, foreground and background color index, respectively. See Appendix G Graphical Control Colors in the Developers Reference.
Return value:
0 OK. 1 Error. 9 Error, control not found.
protected int PanListGetNum(String controlID) throws IllegalArgumentException
This function can also be used with combination boxes.
protected int PanCheckSet(String controlID, int checkState) throws IllegalArgumentException
The control ID is for radio button or check box. This also works on the panel's menu items. If an asterisk (*) is typed before the control ID, the application panel's menu item with this ID will be processed instead.
Return value:
0 OK. 1 Error, unable to select. 9 Error, control not found.
IllegalArgumentException
PanCheckGet(java.lang.String)
protected int PanCheckGet(String controlID) throws IllegalArgumentException
The control ID is for radio button or check box. This also works on the panel's menu items. If an asterisk (*) is typed before the control ID, the application panel's menu item with this ID will be processed instead.
Return value:
0 Control is unchecked. 1 Control is checked. 2 Control is in third state. 9 Error, control not found.
IllegalArgumentException
PanCheckSet(java.lang.String, int)
protected String PanGetText(String textID) throws IllegalArgumentException
IllegalArgumentException
PanXlate(java.lang.String)
protected String PanXlate(String text)
The string is empty if no matching translation is found.
PanGetText(java.lang.String)
protected int PanSetFocus(String controlID, int selectControl) throws IllegalArgumentException
selectControl
can be 0 or 1 if the control should
be selected.
Return value:
0 OK. 1 Error. 9 Error, control not found.
IllegalArgumentException
PanSelectCurrCtl()
protected int PanSelectCurrCtl()
E.g. it is used to show the user that an error message has occurred.
Return value:
0 OK. 1 Error.
protected int PanUpdate()
This function should be called when the text and/or translation file is swapped. A panel with static texts, prompts, headers, etc., connected to host fields is not updated when the host changes, only when the panel is created the first time or when the panel becomes active again! In cases where one wants to update these controls, use this function. However, do not call PanUpdate from an object that is processing a HostChange (HCHG) message. The function PanUpdate sends a HostChange directly after it is completed.
Warning: If a call to PanUpdate is made from a HostChange (HCHG) this will cause the program to loop.
Return value:
0 OK. 1 Error.
protected int PanSetCurFromHost()
Return value:
0 OK. 1 Error, unable to position cursor.
protected int PanSetPanelFromHost(String[] panels) throws IllegalArgumentException
Once the correct panel has been found containing a control at the current host cursor position, the panel will be loaded and shown (if not already there) and the cursor position will be placed accordingly in the panel.
Return value:
0 OK. 1 Error. 8 Unable to find a panel that matches the host field position. 9 Unable to find the current host field related to the cursor position.
IllegalArgumentException
PanSetCurFromHost()
,
PanSelectCurrCtl()
protected String PanChart(String controlID, String function, String data) throws IllegalArgumentException
For a list of functions, data and return values, see the Business Graphics section in the Developers Reference.
Return value:
0 OK. 9 Error, control not found. other See the NetPhantom documentation.
IllegalArgumentException
protected int PanComboFromFile(String controlID, String fileName) throws IllegalArgumentException
The text file can have one or two columns separated by a tab char (ASCII character 9). It will be written in OEM ASCII text character set. If it consists of only one column, it contains texts that will be presented in the combination box. If made up of two columns, the first column is the host conversion code and the second column is the text that will be presented in the combination box (e.g. "05[tab]This is the text").
Return value:
0 OK. 1 Error. 5 Error, file not found. 6 Error, read error. 9 Error, control not found.
IllegalArgumentException
PanListFromFile(java.lang.String, java.lang.String)
protected String PanGetCurrPanel()
protected int PanCallCtl(String controlID) throws IllegalArgumentException
controlID
.
Control IDs may reference a control on any created panel.
Return value:
0 OK. 9 Error, control not found.
IllegalArgumentException
protected String PanFormatText(String text)
Other text in the string is not affected, except for literal @-characters. Returns the resolved string string. @-sequences make it possible to read host fields, get text strings from the text file, use translation tables and read global variables and special variables with system information.
For more information on @-sequences in strings, see 8.4 Special Functions for Text Strings in the User's Guide. The sequence @**PANELID@ cannot be used from a program object.
protected String PanGetDllExt(String name)
The purpose of this function is to add 'NT', 'W3' or '32' to a dllName stub, for example 'PHBUT', if and only if the Add extension box is checked (in Application data). No file name extension (.DLL) should be included. If the dllName is longer than six characters it will be truncated to six characters before the extension is appended.
Because the NetPhantom Java environment is system independent, no string will be added as opposed to the Phantom Runtime for Windows NT/95, OS/2 or Windows 3.1.
protected int PanNbCancelPaging()
This function is used when the host system has the possibility of jumping to the required page directly or if paging needs to be interrupted due to, for example, an error situation.
When a user presses a notebook tab, the object connected to the action of the page(s) is started until an error occurs. If the object runs in a separate thread, i.e. is a Java Application, special care must be taken because multiple threads might be started. The preferred Java object type is Java Macro because it is started synchronously within the same thread as the NetPhantom client session.
There is no need to lock the panel or to turn off processing when this function is used. When a notebook tab is clicked, just cancel paging when the transaction is sent.
When a user selects a notebook tab, NetPhantom normally will start to turn pages one by one until the desired page is reached, using the defined prev/next actions. This function will prevent this from happening, which makes it possible to use a single object to turn pages.
Return value:
0 OK. 1 Error.
Example:
The host supports direct access to any notebook page. The object is defined as a Java Macro.
if ( argMsg != CMD ) return; // Get the page index of the destination. String dest = Word(argStr,1); // Command Jnn jumps to page nn int rc = HostSetFld(null, "PAGEJUMP", "J"+dest); rc = HostSend("@E"); rc = PanNbCancelPaging();
Example:
The host requires a send key F7 or F8 for each page. This is normally handled by NetPhantom, but we want some extra error checking.
if ( argMsg != CMD ) return; // We do the error checking now String errMsg = DoOurErrorChecking(); if ( !errMsg.isEmpty() ) { PanNbCancelPaging(); Message(2, 2, errMsg); return; } // Get the function key to send: F7 or F8 String dest = Word(string, 1); String prev = Word(string, 5); String sendKey; if ( dest.compareTo(prev) < 0 ) sendKey = "@7"; else sendKey = "@8"; int rc = HostSend(sendKey); return;
protected String PanGetCurrNbPage(String controlID) throws IllegalArgumentException
The controlID
can be set to null if there
is just one notebook in the topmost panel.
The string is empty if there is no current notebook page or the notebook cannot be found.
IllegalArgumentException
protected int PanSetTextFile(String fileName) throws IllegalArgumentException
The file name should be specified without an extension (which will be .PHM). The file name may be up to 8 characters in length
Returns
0 = OK. 1 = Error, unable to load file.
IllegalArgumentException
PanGetText(java.lang.String)
protected int PanSetXlateFile(String fileName) throws IllegalArgumentException
The file name should be specified without an extension (which will be .PHX). The file name may be up to 8 characters in length
Returns
0 = OK. 1 = Error, unable to load file.
IllegalArgumentException
PanXlate(java.lang.String)
protected String PanGetFocus()
protected int PanGetCtlLen(String controlID)
Returns
1-nn = length. 0 = Error, control not found or length not supported by control.
protected int PanSetCtlLen(String controlID, int length)
Returns
0 = OK. 1 = Error, length not supported by control. 9 = Error, control not found.
protected int SessionStart(String sessionID) throws IllegalArgumentException
Return value:
0 OK. 1 Error.
IllegalArgumentException
SessionStop(java.lang.String)
protected int SessionSelect(String sessionID) throws IllegalArgumentException
Return value:
0 OK. 1 Error.
IllegalArgumentException
SessionStart(java.lang.String)
protected int SessionStop(String sessionID) throws IllegalArgumentException
Return value:
0 OK. 1 Error.
IllegalArgumentException
SessionStart(java.lang.String)
protected int SessionExit()
Return value:
0 OK. 1 Error.
PanelExit()
protected int PanelExit()
Return value:
0 OK. 1 Error.
SessionExit()
protected String SessionGet()
SessionGetAll()
protected String SessionGetAll()
SessionGet()
protected String ClipbrdGet()
Return value:
data Clipboard data or empty string.
protected int ClipbrdSet(String data)
Parameters:
data Data to send to clipboard.
Return value:
0 No error. 1 Error.
protected int TimerStart(int timerNo)
Return value:
0 OK. 1 Error.
TimerStop(int)
,
TimerPause(int)
,
TimerGet(int)
protected int TimerPause(int timerNo)
Return value:
0 OK. 1 Error.
TimerStart(int)
,
TimerStop(int)
,
TimerGet(int)
protected int TimerStop(int timerNo)
Return value:
0 OK. 1 Error.
TimerStart(int)
,
TimerPause(int)
,
TimerGet(int)
protected String TimerGet(int timerNo)
TimerStart(int)
,
TimerPause(int)
,
TimerStop(int)
protected int CompLine(int line, String string) throws IllegalArgumentException, NumberFormatException
Parameters:
line Host line number(1-nn). string String to compare with host. timer Timer to stop (1-9, 0 = no timer).
Return Value:
0 No error. 1 Communication error with host. 4 String not found.
protected int WCompLine(int line, String string, int timer) throws IllegalArgumentException, NumberFormatException
This method waits for the host to compare with string. It is not possible to use this method from a REXX macro.
Parameters:
line Host line number(1-nn). string String to compare with host. timer Timer to stop (1-9, 0 = no timer).
Return Value:
0 No error. 1 Communication error with host. 2 Time-out.
protected int CompPos(int line, int column, String string) throws IllegalArgumentException, NumberFormatException
Parameters:
line Host line number(1-nn). column Host column number (1-nn). string String to compare with host. timer Timer to stop (1-9, 0 = no timer).
Return Value:
0 No error. 1 Communication error with host. 2 Time-out. 4 String not found.
protected int WCompPos(int line, int column, String string, int timer) throws IllegalArgumentException, NumberFormatException
This method waits for the host to compare with string. It is not possible to use this method from a REXX macro.
Parameters:
line Host line number(1-nn). column Host column number (1-nn). string String to compare with host. timer Timer to stop (1-9, 0 = no timer).
Return Value:
0 No error. 1 Communication error with host. 2 Time-out.
protected int CompScreen(String string) throws IllegalArgumentException, NumberFormatException
Parameters:
string String to compare with host. timer Timer to stop (1-9, 0 = no timer).
Return Value:
0 No error. 1 Communication error with host. 2 Time-out. 4 String not found.
protected int WCompScreen(String string, int timer) throws IllegalArgumentException, NumberFormatException
This method waits for the host to compare with string. It is not possible to use this method from a REXX macro.
Parameters:
string String to compare with host. timer Timer to stop (1-9, 0 = no timer).
Return Value:
0 No error. 1 Communication error with host. 2 Time-out.
protected int DdeExecute(int dde_nn, String command) throws IllegalArgumentException
Parameters:
dde_nn Handle retrieved from DdeInitiate. Location Location (e.g. position in Excel sheet). Data Data to EXECUTE.
Return Value:
0 OK. 1 DDE communication error.
protected int DdeInitiate(String programName, String subject) throws IllegalArgumentException
Parameters:
ProgramName Name of the program to be communicated with. Subject String subject (e.g. Excel sheet).
Return Value:
0 Error. dde_nn Handle for this conversation. The handle is a numeric value which should be used for further communication.Example:
excel = DdeInitiate('Excel','DEMO.XLS')
protected int DdePoke(int dde_nn, String location, String data) throws IllegalArgumentException
Parameters:
dde_nn Number retrieved from DdeInitiate. Location Location (e.g. position in Excel sheet). Data Data to EXECUTE.
Return Value:
0 OK. 1 DDE communication error.Example:
rc = DdePoke(excel,'R2C4','123')
protected int DdeTerminate(int dde_nn) throws IllegalArgumentException
Parameters:
dde_nn Handle retrieved from DdeInitiate.
Return Value:
0 OK. 1 DDE communication error.
IllegalArgumentException
DdeExecute(int, java.lang.String)
,
XDdeExecute(int, java.lang.String)
,
DdeInitiate(java.lang.String, java.lang.String)
,
XDdeInitiate(java.lang.String, java.lang.String, java.lang.String)
,
DdePoke(int, java.lang.String, java.lang.String)
,
XDdePoke(int, java.lang.String, java.lang.String)
protected int XDdeAdvise(int hConv, String item, int flags) throws IllegalArgumentException
Parameters:
hConv Numeric value that identifies the requested DDE conversation. Item String that identifies the item within a conversation. Flags Flags indicating the method to use. 0 Update changed data with a DDEDATA UPDATE message. 2 Update changed data with a DDEDATA UPDATE message after which the DDE Engine will acknowledge reception of that data. This method might be useful if the data changes very rapidly causing flooding of the message queue. 4 Signal that a data item has changed by sending a DDEDATA UPDATE message without the data. This method is used if the calling object wants to control when the update is performed. The calling object can request the data after receiving the signal by calling XDdeRequest.
Return Value:
0 Request not submitted (Error). hReq Request handle. This request handle identifies the advise link.Example:
hrAdv = XDdeAdvise(hcExcel, 'R4C2', '0')
IllegalArgumentException
XDdeUnadvise(int, int)
,
XDdeRequest(int, java.lang.String)
protected int XDdeExecute(int hConv, String command) throws IllegalArgumentException
Parameters:
hConv Handle that identifies the requested DDE conversation. Command Command string.
Return Value:
0 Request not submitted (Error). hReq Request handle.Example:
hReq = XDdeExecute(hcServer, 'OPEN REPORT')
IllegalArgumentException
XDdePoke(int, java.lang.String, java.lang.String)
protected int XDdeInitiate(String progName, String topicName, String objectName) throws IllegalArgumentException
Parameters:
ProgName (DDE) name of the application that serves the requested conversation. TopicName Name of the topic that identifies the conversation topic. ObjectName Name of the calling object. This name is needed by the DDE Engine to dispatch notification messages.
Return Value:
0 No conversation established. hConv Conversation handle. The handle is a numeric value that identifies the requested DDE conversation. Every incoming DDE client message (DDECONN, DDEERR, DDEDATA) will pass this handle for verification.Example:
hcExcel = XDdeInitiate('Excel', 'DEMO.XLS', 'DEMO')
IllegalArgumentException
XDdeTerminate(int)
protected int XDdePoke(int hConv, String item, String data) throws IllegalArgumentException
Parameters:
hConv Handle that identifies the requested DDE conversation. Item String that identifies the item within a conversation. Data Data string.
Return Value:
0 Request not submitted (Error). hReq Request handle.Example:
hReq = XDdePoke(hcExcel, 'R2C3', '42')
IllegalArgumentException
XDdeExecute(int, java.lang.String)
protected int XDdeRequest(int hConv, String item) throws IllegalArgumentException
Parameters:
hConv Handle that identifies the requested DDE conversation. Item String that identifies the item within a conversation.
Return Value:
0 Request not submitted (Error). hReq Request handle.Example:
hReq = XDdeRequest(hcExcel, 'R4C2')
protected int XDdeTerminate(int hConv) throws IllegalArgumentException
Parameters:
hConv Handle that identifies the requested DDE conversation.
Return Value:
0 Request submitted. non-zero Request not submitted (Error).Example:
rc = XDdeTerminate(hcExcel)
protected int XDdeUnadvise(int hConv, int hReq) throws IllegalArgumentException
Parameters:
hConv Handle that identifies the requested DDE conversation. hReq Request handle. This request handle identifies the advise link.
Return Value:
0 Request submitted. non-zero Request not submitted (Error). This function does not return a request handle because it reuses the hReq request handle passed in the call.Example:
rc = XDdeUnadvise(hcExcel, hrAdv)
IllegalArgumentException
XDdeAdvise(int, java.lang.String, int)
protected int XDdeUpdate(String topic, String item, String data) throws IllegalArgumentException
Parameters:
Topic Topic string. Item Item string. Data Data string.
Return Value:
0 OK. non-zero Error.Example:
rc = XDdeUpdate('STATUS', 'PROC1', 'READY')
IllegalArgumentException
protected int FileCreate(String fileName) throws IllegalArgumentException
Return value:
0 OK. 1 Unable to create file: incorrect file name, file is locked or file attribute is read-only.
IllegalArgumentException
FileAppend(java.lang.String, java.lang.String)
protected int FileAppend(String fileName, String data) throws IllegalArgumentException
Return value:
0 OK. 1 Unable to add data to file: incorrect file name, file is locked or file attribute is read-only.
IllegalArgumentException
FileCreate(java.lang.String)
protected int Message(int type, int icon, String message)
Note: At this time, only a REXX application (i.e. running in a separate thread can be used to retrieve the return value. This is due to the fact that the client can repond to the message at a later time. This limitation may be removed in the future.
Type:
1 Message with Cancel button. 2 Message with OK button. 3 Message with OK/Cancel question. 4 Message with Enter button. 5 Message with Enter/Cancel question. 6 Message with Yes/No question. 7 Message with Yes/No/Cancel question. 8 Message with Retry/Cancel question. 9 Message with Retry/Ignore/Cancel question.Icon:
1 No icon 2 Information code 3 Question mark 4 Warning code 5 Stop codeReturn value:
0 Incorrect parameters. 1 Response: Cancel. 2 Response: OK. 3 Response: Enter. 4 Response: Yes. 5 Response: No. 6 Response: Retry. 7 Response: Ignore.
protected String CallObject(String objectID, String controlID, int action, String string) throws IllegalArgumentException
If a Java macro object is called from a REXX application, the REXX application will be stopped until the Java macro has completed. On the other hand, if an object that is of the Phantom Macro or REXX application type is called, the execution of the object is started asynchronously. This means that both objects run simultaneously in separate threads.
The arguments to the object are not processed by NetPhantom and can be set to any strings. The limits of the length for the strings is 8 for ControlID and 250 for String.
The actions are: CRT, REM, UCHG, HCHG, FOC, DEFOC, CLK, DBLCLK, CMD, SEL, CLOSE, CHAR, CHECK, HIDDEN, RECRT, XLATE, START, SHOW, QMSG.
Parameters:
objectID Name of the object. controlID A control ID passed to the object in argID. action The object action passed in argMsg to the object. string The string passed to the object as argStr.Return value:
0 OK. 1 General error. 8 Error, action not found. 9 Error, object not found. Other Other returned strings depend on what the object returns.
IllegalArgumentException
protected int Wait(int seconds)
protected int LogonGet()
LogonSet(int)
protected int LogonSet(int logonFlag) throws IllegalArgumentException
IllegalArgumentException
LogonGet()
protected int GlobVarSet(String varName, String data) throws IllegalArgumentException
Return value:
0 No error. 1 Error, cannot set the variable.
protected String GlobVarGet(String varName) throws IllegalArgumentException
If the global variable cannot be retrieved, an empty string is returned.
protected int GlobVarDelete(String varName) throws IllegalArgumentException
Return value:
0 No error. 1 Error, cannot delete the variable. 9 Variable not found.
protected int SessVarSet(String varName, String data) throws IllegalArgumentException
Return value:
0 No error. 1 Error, cannot set the variable.
IllegalArgumentException
SessVarDelete(java.lang.String)
,
SessVarGet(java.lang.String)
,
GlobVarGet(java.lang.String)
,
GlobVarSet(java.lang.String, java.lang.String)
,
GlobVarDelete(java.lang.String)
,
SessionStart(java.lang.String)
,
SessionStop(java.lang.String)
,
SessionSelect(java.lang.String)
protected String SessVarGet(String varName) throws IllegalArgumentException
If the session variable cannot be retrieved, an empty string is returned.
IllegalArgumentException
SessVarDelete(java.lang.String)
,
SessVarSet(java.lang.String, java.lang.String)
,
GlobVarGet(java.lang.String)
,
GlobVarSet(java.lang.String, java.lang.String)
,
GlobVarDelete(java.lang.String)
,
SessionStart(java.lang.String)
,
SessionStop(java.lang.String)
,
SessionSelect(java.lang.String)
protected int SessVarDelete(String varName) throws IllegalArgumentException
Return value:
0 No error. 1 Error, cannot delete variable. 9 Variable not found.
IllegalArgumentException
SessVarGet(java.lang.String)
,
SessVarSet(java.lang.String, java.lang.String)
,
GlobVarGet(java.lang.String)
,
GlobVarSet(java.lang.String, java.lang.String)
,
GlobVarDelete(java.lang.String)
,
SessionStart(java.lang.String)
,
SessionStop(java.lang.String)
,
SessionSelect(java.lang.String)
protected PhantomHostField getHostFieldFromID(String screenName, String fieldName)
protected PhantomHostScreen getHostScreenFromID(String screenName)
protected VirtualInterface getVirtualComponentFromID(String compID)
protected String Time(String form)
NetRexxMigration
protected String Date(String form)
NetRexxMigration
protected String CharIn(String stream, long position, int length)
If you specify a length of 0, then the read position will be set to the value of start, but no characters are read and the null string is returned. In a transient stream, if there are fewer then length characters available, then execution of the program will normally stop until sufficient characters do become available. If, however, it is impossible for those characters to become available due to an error or other problem, the NOTREADY condition is raised and CharIn will return with fewer than the requested number of characters.
Here are some examples:
CHARIN(myfile,1,3) = 'MFC' -- the first 3 characters CHARIN(myfile,1,0) = '' -- now at start CHARIN(myfile) = 'M' -- after last call CHARIN(myfile,,2) = 'FC' -- after last callNote: CharIn returns all characters that appear in the stream including control characters such as line feed, carriage return, and end of file.
protected long CharOut(String streamname, String data, long position)
A start value can be given to specify an explicit write position for a persistent stream. This write position must be a positive whole number within the bounds of the stream (though it can specify the character position immediately after the end of the stream). A value of 1 for start refers to the first character in the stream.
Note: In some environments, overwriting a stream with CharOut or LineOut can erase (destroy) all existing data in the stream.
protected long Chars(String streamname)
Here are some examples:
CHARS(myfile) = 42 -- perhaps CHARS(nonfile) = 0 -- perhaps
protected String FileSpec(String opt, String path)
Drive The drive letter of the given filespec. Path The directory path of the given filespec. Name The filename of the given filespec.If the requested string is not found, then FileSpec returns an empty string.
Note: Only the initial letter of option is needed.
Here are some examples:
thisfile = "C:\UTIL\EXAMPLE.EXE" say FILESPEC("drive",thisfile) -- says "C:" say FILESPEC("path",thisfile) -- says "\UTIL\" say FILESPEC("name",thisfile) -- says "EXAMPLE.EXE"
protected String LineIn(String streamname, long pos, long count)
If a count of 0 is given, then no characters are read and the null string is returned. For transient streams, if a complete line is not available in the stream, then execution of the program will normally stop until the line is complete. If, however, it is impossible for a line to be completed due to an error or other problem, the NOTREADY condition is raised and LineIn returns whatever characters are available.
Here are some examples:
myfile = 'ANYFILE.TXT' LINEIN(myfile) = 'Current line' -- Reads one line from . -- ANYFILE.TXT, beginning . -- at the current read . -- position. (If first call, . -- file is opened and the . -- first line is read.) . LINEIN(myfile,1,1) = 'first line' -- Opens and reads the first . -- line of ANYFILE.TXT (if . -- the file is already open, . -- reads first line); sets . -- read position on the . -- second line. . LINEIN(myfile,1,0) = '' -- No read; opens ANYFILE.TXT . -- (if file is already open, . -- sets the read position to . -- the first line). . LINEIN(myfile,,0) = '' -- No read; opens ANYFILE.TXT . -- (no action if the file is . -- already open).
protected int LineOut(String streamname, String data, long line)
For persistent streams, a write position is maintained for each stream. Any write to the stream starts at the current write position by default. Characters written by a call to LineOut can be added to a partial line. LineOut conceptually terminates a line at the end of each call. When the write is completed, the write position is set to the beginning of the line following the one just written. The initial write position is the end of the stream, so that calls to LineOut normally append lines to the end of the stream.
You can set the write position to the first character of a persistent stream by giving a value of 1 (the only valid value) for line.
Note: In some environments, overwriting a stream using CharOut or LineOut can erase (destroy) all existing data in the stream.
Execution of the program normally stops until the output operation is effectively completed. If, however, it is impossible for a line to be written, the NOTREADY condition is raised and LineOut returns with a result of 1 (that is, the residual count of lines written).
Here are some examples:
myfile = 'ANYFILE.TXT' LINEOUT(myfile,'A new line') -- Opens the file ANYFILE.TXT and . -- appends the string to the end. . -- If the file is already open, . -- the string is written at the . -- current write position. . -- Returns 0 if successful. . LINEOUT(myfile,'A new start',1) -- Opens the file (if not already . -- open); overwrites first line . -- with a new line. . -- Returns 0 if successful. . LINEOUT(myfile,,1) -- Opens the file (if not already . -- open). No write; sets write . -- position at first character. . LINEOUT(myfile) -- Closes ANYFILE.TXT
protected int Lines(String streamname)
The form of the name is implementation dependent.
Here are some examples:
LINES(myfile) = 0 -- at end of the file . LINES("COM1:") = 1 -- An OS/2 device name . -- always returns '1'Note: The Chars function returns the number of characters in a persistent stream or the presence of data in a transient stream.
protected String Stream(String streamname, String operation, String command)
The first argument, name, specifies the stream to be accessed. The second argument can be one of the following strings (of which only the first letter is needed) which describes the action to be carried out:
Command
An operation (specified by the stream command given as the third argument)
to be applied to the selected input or output stream. The string that is returned
depends on the command performed, and can be the empty string.
Description
Also returns the current state of the specified stream. It is identical to
the State operation, except that the returned string is followed by a colon and,
if available, additional information about ERROR or NOTREADY states.
State
Returns a string that indicates the current state of the specified stream.
This is the default operation. When used with the State option, Stream returns
one of the following strings:
'ERROR' The stream has been subject to an erroneous operation (possibly during . input, output, or through the Stream function. Additional information . about the error may be available by invoking the Stream function with a . request for the implementation-dependent description. . 'NOTREADY' The stream is known to be in a state such that normal input or output . operations attempted upon it would raise the NOTREADY condition. For . example, a simple input stream may have a defined length; an attempt . to read that stream (with the CharIn or LineIn functions, perhaps) . beyond that limit may make the stream unavailable until the stream has . been closed, for example, with LineIn(name), and then reopened. . 'READY' The stream is known to be in a state such that normal input or output . operations can be attempted. This is the usual state for a stream, . though it does not guarantee that any particular operation will succeed. . 'UNKNOWN' The state of the stream is unknown. This response can be used to indicate . that the state of the stream cannot be determined.
Stream Commands
The following stream commands are used to:
- Open a stream for reading or writing
- Close a stream at the end of an operation
- Position the read or write position within a persistent stream (for example, a file)
- Get information about a stream (its existence, size, and last edit date).
The stream command argument must be used when you select the operation C (command).
The syntax is:
STREAM(name,'C',streamCommand)In this form, the Stream function itself returns a string corresponding to the given stream command if the command is successful. If the command is unsuccessful, Stream returns an error message string in the same form as that supplied by the D (Description) operation.
Command strings
The argument stream command can be any expression that evaluates as one of the
following command strings:
'OPEN' Opens the named stream. The default for 'OPEN' is to open the stream . for both reading and writing data. To specify whether name is only to . be read or only to be written to, add the word READ or WRITE to the . command string. . . The Stream function itself returns 'READY' if the named stream is . successfully opened or an appropriate error message if unsuccessful. . . stream(strout,'c','open') . stream(strout,'c','open write') . stream(strinp,'c','open read') . 'CLOSE' Closes the named stream. The STREAM function itself returns 'READY' . if the named stream is successfully closed or an appropriate error . message otherwise. . . If an attempt is made to close an unopened file, then Stream returns . an empty string. . . stream('STRM.TXT','c','close') . 'SEEK' offset Sets the read or write position a given number (offset) within a . persistent stream. Note: In environments in which the read and write . positions are the same. To use this command, the named stream must . first be opened (with the 'OPEN' stream command, described previously). . The offset number can be preceded by one of the following characters: . . = Explicitly specifies the offset from the beginning . of the stream. This is the default if no prefix is supplied. . . < Specifies offset from the end of the stream. . . + Specifies offset forward from the current read or write position. . . - Specifies offset backward from the current read or write position.The Stream function itself returns the new position in the stream if the read or write position is successfully located; an appropriate error message is displayed otherwise.
. rc = stream(name,'c','seek =2') . rc = stream(name,'c','seek +15') . rc = stream(name,'c','seek -7') . fromend = 125 . rc = stream(name,'c','seek <'fromend)Used with these stream commands, the Stream function returns specific information about a stream.
'QUERY EXISTS' Returns the full path specification of the named stream, if it . exists, and a null string otherwise. . . stream('file.txt','c','query exists') . 'QUERY SIZE' Returns the size in bytes of a persistent stream. . . stream('file.txt','c','query size') . 'QUERY DATETIME' Returns the date and time stamps of a stream. . . stream('file.txt','c','query datetime') . . The stream (file) last modified date in UTC formatted as RFC 1123, . i.e. in Java date formatEEE, dd MMM yyyy HH:mm:ss 'GMT'
, . e.g.Sun, 21 Feb 2022 12:16:24 GMT
.
protected String Report(String com, String p1, String p2, String p3, String p4, String p5)
com
- The report command to execute.protected String SendEmail(String com, String p1)
com
- The mail command to execute.protected String SendSMS(String command, String param1, String param2)
command
- The sms command to execute.param1
- The phone number or a comma-separated list of phone numbers.param2
- The messageprotected int ShowDocument(String url, String target)
url
- The URL of the document.target
- The HTML window target, _blank is default.protected String ClientExecute(boolean async, String command, String data)
protected String ExecuteProcess(String dir, boolean useRuntimeDir, String cmdLine)
A return code less than zero indicates an error.
protected String CreateTempFile()
protected int RemoveTempFile(String fileName)
protected int DeleteFile(String fileName)
protected int PanSetCtlProperty(String controlID, String property, String data) throws IllegalArgumentException
If ControlID is *PANEL
the text for the current panel is set.
If it is *APP
the text for the application panel is set.
Return value:
0 OK. 1 Error. 9 Error, control not found.
protected String PanGetCtlProperty(String controlID, String property) throws IllegalArgumentException
If ControlID is *PANEL
, the text for the current panel is
retrieved. If it is *APP
the text for the application panel is retrieved.
protected boolean PanSetRatioAndFontScaling(int ratioX, int ratioY, boolean doScaleFonts)
Note: when these settings are changed, it is important to quickly display a MAIN panel that has the option "Change main panel size" in order to recalculate the size and fonts correctly.
ratioX
- the ratio in X for scaling in percent (%), 100=normal.ratioY
- the ratio in Y for scaling in percent (%), 100=normal.doScaleFonts
- flag indicating if the fonts should be scaled as well.protected boolean PanEnableClientProcessing(boolean on)
on
- true to enable processing, false to disable it.protected boolean PanIsClientProcessingEnabled()
protected boolean StartLog()
protected boolean StopLog()
protected boolean RotateLog()
protected boolean LogMsg(String msg)
public CodepageConverter getCodepageConverter()
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.