The Screen class assists the mapping of protocols which represent
screens of information to the user -- such as Videotex. Data received down
a comms line can be put on the screen and then analysed.
Triggers can be set up on the screen which fire when their trigger-conditions are satisfied. The list of available trigger types is as follows:
home |
the 'home' character is received |
reset |
the 'reset' character is received |
cursorOn |
the 'cursor-on' character is received |
cursorOff |
the 'cursor-off' character is received |
hotText |
the supplied text appears at the given position on screen |
hotPatch |
the cursor enters the supplied region of the screen |
exitZone |
the cursor leaves the supplied region of the screen |
messageRow |
a message appears on the supplied row of the screen |
The create function can be used to create a Screen
object of a given no. of rows and columns e.g.
(create Screen 24 40)
Once created, this module is tailored using its properties
and methods.
A Screen object supports the following properties:
| property name | property type | description |
|---|---|---|
row |
Integer |
current display row (0 based) |
column |
Integer |
current display column (0 based) |
nRows |
Integer |
number of rows on the screen |
nColumns |
Integer |
number of columns on the screen |
carriageReturnChar |
Integer |
character used as the 'carriage return' character to go to the start of the row |
lineFeedChar |
Integer |
character used as the 'line-feed' character to go down a row |
homeChar |
Integer |
character used as the 'home' character to go to the initial row and column without changing the screen contents |
resetChar |
Integer |
character used as the 'reset' character to go to the initial row and column and clearing the screen |
cursorOnChar |
Integer |
character used as the 'cursor-on' character which turns on the display of the cursor |
cursorOffChar |
Integer |
character used as the 'cursor-off' character which turns off the display of the cursor |
escapeChar |
Integer |
character used as the 'escape' character which makes the following character have a special meaning |
verticalTabChar |
Integer |
character used as the 'vertical tab' character to go up one row |
backspaceChar |
Integer |
character used as the 'backspace' character to go back one character |
tabChar |
Integer |
character used as the 'tab' character to go forward one character |
log |
Log |
a log for the screen |
The Screen object supports the following methods:
| method name | description |
|---|---|
display |
display the supplied text on the screen at the current cursor position |
displayAt |
display the supplied text on the screen at the supplied cursor position |
extract |
extract text from the screen from the supplied position |
home |
'go home' i.e. move to the initial row and column without changing the screen content |
reset |
reset the screen i.e. move to the initial row and column and clear the screen |
up |
move the cursor position up one line |
down |
move the cursor position down one line |
left |
move the cursor position one character to the left |
right |
move the cursor position one character to the right |
cursor |
return the current cursor position |
isCursorOn |
test if the cursor display is turned on |
cursorOn |
turn the display of the cursor on |
cursorOff |
turn the display of the cursor off |
toHtml |
return an HTML representation of the screen content |
enableTrigger |
enable the identified trigger |
disableTrigger |
disable the identified trigger |
triggerDisplay |
display the supplied text and fire any appropriate enabled triggers |
viewer |
set up a COM object as a viewer to track the display of data on the screen |
string |
return a string representation of the screen |
fromString |
fill the screen from the supplied string representation |
find |
find the supplied piece of text on screen |
displayDisplay the supplied text on the screen at the current cursor position.
Arguments:
| data | String or
Binary
|
Return type: the empty List ()
displayAtDisplay the supplied text on the screen at the supplied cursor position -- the current cursor position is not affected.
Arguments:
| data | String or
Binary
|
| row | Integer |
| column | Integer |
Return type: the empty List ()
extractExtract text from the screen from the supplied position.
Arguments:
| row | Integer |
| column | Integer |
| length | Integer |
Return type: String
home'Go home' i.e. move to the initial row and column without changing the screen content.
Arguments: none
Return type: the empty List ()
resetReset the screen i.e. move to the initial row and column and clear the screen.
Arguments: none
Return type: the empty List ()
upMove the cursor position up one line.
Arguments: none
Return type: the empty List ()
downMove the cursor position down one line.
Arguments: none
Return type: the empty List ()
leftMove the cursor position one character to the left.
Arguments: none
Return type: the empty List ()
rightMove the cursor position one character to the right.
Arguments: none
Return type: the empty List ()
cursor
Return the current cursor position as a list of
two integers (row column).
Arguments: none
Return type: List
isCursorOnTest if the cursor display is turned on.
Arguments: none
Return type: the empty List ()
is returned if the cursor display is off, otherwise non-() is returned.
cursorOnTurn the display of the cursor on.
Arguments: none
Return type: the empty List ()
cursorOffTurn the display of the cursor off.
Arguments: none
Return type: the empty List ()
toHtmlReturn an HTML representation of the screen content -- this forms the content of an HTML <table> statement.
Arguments: none
Return type: String
enableTriggerEnable the identified trigger.
Arguments:
The initial argument is the trigger name -- any subsequent arguments are trigger-dependent. Any trigger can be re-enabled simply by supplying its name. Certain triggers require additional arguments when they are set up i.e. when they are initially enabled.
Enabling the following triggers requires no additional arguments:
home
reset
cursorOn
cursorOff
Setting up the hotText trigger requires the following arguments:
| triggerName | String i.e. "hotText" |
| text | String |
| row | Integer |
| column | Integer |
Setting up the hotPatch trigger requires the following arguments:
| triggerName | String i.e. "hotPatch" |
| row | Integer |
| column | Integer |
| nRows | Integer |
| nColumns | Integer |
Setting up the exitZone trigger requires the following arguments:
| triggerName | String i.e. "exitZone" |
| row | Integer |
| column | Integer |
| nRows | Integer |
| nColumns | Integer |
Setting up the messageRow trigger requires the following arguments:
| triggerName | String i.e. "messageRow" |
| row | Integer |
Return type: the empty List ()
disableTriggerDisable the identified trigger.
Arguments:
| triggerName | String |
Return type: the empty List ()
triggerDisplayDisplay the supplied text and fire any appropriate enabled triggers.
Arguments:
| text | String or
Binary
|
Return type: a List of trigger names
which have fired
viewerSet up a COM object as a viewer to track the display of data on the screen.
Arguments:
| viewer | Dispatch |
Return type: the empty List ()
stringReturn a string representation of the screen.
Arguments: none
Return type: String
fromStringFill the screen from the supplied string representation.
Arguments:
| info | String |
Return type: the empty List ()
find
Find the supplied piece of text on screen -- the search starts checking at the
supplied screen row and column. If supplied and non-(),
the optional 4th argument makes the matching case-insensitive. The default is
to do a case-sensitive search.
Arguments:
| text | String |
| row | Integer |
| column | Integer |
| optional caseSensitivity | Object |
Return type: List
| Contents | Index | Current topic: communications | Related links: objects, built-in objects |