Screen Object
Description
The Screen object provides access to CRT's terminal screen.
Syntax
Remarks
CRT's Screen object is accessed through the top-level objectÆs æScreenÆ property.
Screen Object Properties and Methods
ááááCurrentColumn |
ááááClear |
ááááCurrentRow |
ááááGet |
ááááColuumns |
ááááPrint |
ááááRows |
ááááSend |
ááááSynchronous |
ááááSendSecial |
|
ááááWaitForCursor |
|
ááááWaitForKey |
|
ááááWaitForString |
|
ááááWaitForStrings |
Description
Returns the current column of the cursor.
Syntax
Remarks
Read-only numeric property. The first column is 1. An error will be returned if there is no connection open.
Description
Returns the current row of the cursor.
Syntax
Remarks
Read-only numeric property. The first row is 1. An error will be returned if there is no connection open.
Description
Returns the current number of columns.
Syntax
Remarks
Read-only numeric property.
Description
Returns the current number of rows
Syntax
Remarks
Read-only numeric property.
Description
Returns or sets the Synchronous setting of the screen.
Syntax
Remarks
If Synchronous is False then under certain circumstances a script can miss data sent by the server that it is expecting to see. Synchronous is set to False by default, and should only be set to true in circumstances when a possibility of a script missing data exists. Scripts should then return the Synchronous state to False.
For example, the following code that waits for two different strings could potentially miss the second string while it is performing some operation after receiving the first string. In order to prevent this kind of condition, it temporarily sets Synchronous to True:
Description
Clears the screen.
Syntax
Remarks
None.
Description
Returns a string of characters read for a portion of the screen.
Syntax
Remarks
Returns a string containing the characters on the screen rectangle defined by the numeric values row1,col1 (upper-left) and row2,col2 (lower-right).
Description
Prints the screen
Syntax
Remarks
If no printer is defined on your machine, an error will be returned.
Description
Sends a string of characters.
Syntax
Remarks
Attempting to send a string while no connection is open returns an error.
Description
Sends a special
Syntax
Remarks
The string parameter to SendSpecial should describe one of the special CRT or protocol functions. Attempting to use SendSpecial while no connection is opened will result in an error.
Examples:
Description
Wait for the cursor to change position.
Syntax
Remarks
The optional timeout parameter specifies the number of seconds to wait for the change. If a change of cursor position is detected WaitForCursor() returns True. If a timeout occurs the function returns False. If no timeout is specified then WaitForCursor() will not time out. An error will be returned if there is no connection open.
Description
Wait for a keypress event.
Syntax
Remarks
The optional timeout parameter specifies the number of seconds to wait for a key event. If key event is detected WaitForKey() returns True. If a timeout occurs the function returns False. If no timeout is specified then WaitForKey() will not time out. An error will be returned if there is no connection open.
Description
Wait for a string.
Syntax
Remarks
Wait for the string to appear in the input. The timeout (seconds) parameter is optional. When the string is detected in the input WaitForString() returns True. If a timeout occurs the function returns False. An error will be returned if there is no connection open.
Example:
Description
Wait for one of several strings to appear in the input.
Syntax
Remarks
Waits for one of the strings given as arguments to appear in the input. When one of the argument strings is matched in the input, WaitForStrings() returns the argument index of the string that was found (the index of the first string given as an argument to WaitForStrings() is 1). If the optional timeout parameter is specified and a timeout occurs before any of the strings are found, WaitForStrings() returns 0. In the absence of a timeout parameter WaitForStrings() will block without timing out and will not return 0. An error will be returned if there is no connection open.
Example:
Notes
If you are using VBScript, WaitForStrings() will accept an array of strings as its first argument followed by an optional timeout. The value returned by WaitForStrings() will be the index of the string found in the array (1st element in the array = 1). A value of 0 will be returned if no strings were found within the timeout period if specified.