Terminal Variables
Create a Terminal variable to open and manage a terminal connection, and to read data from, and write to, the terminal screen.
Extra Terminal
Properties
Property |
Input Type |
Description |
Can Be Modified |
---|---|---|---|
Session Name | Text | The initial value of the session name. | Yes |
Connection Type | Text | The connection type for the terminal. Default value is False and should not be changed unless the terminal service stops does not work otherwise. | Yes |
Code Page | Number | The character encoding code page number. | Yes |
HLLAPI Function Name | Text | The name of the function by which the DLL communicates with the application.1 | Yes |
HLLAPI Dll Path | Text |
The path to the dll for the HLLAPI interface, for example, hllapi32.dll.1 |
Yes |
Screen Text | Text |
The text displayed by the terminal. |
Yes |
Is 64 bit terminal | Boolean |
Whether the terminal application is 64-bit. This is detected automatically and handled transparently. |
No |
1. The HLLAPI DLL itself and the function name must be provided by the customer. The function name will differ from terminal to terminal.
Of the parameters above, Session Name, HLLAPI Function Name, and HLLAPI Dll Path are mandatory for most applications.
The workflow below populates all required properties of a Terminal variable.
- The name of the HLLAPI DLL file to be used (as provided by the customer) is ehalpi32.dll. Its full path is C:\Program Files (x86)\Micro Focus\Extra!\ehlapi32.dll.
-
The name of the function to call is hllapi.
-
The session name is A.
-
The connection type is set to False.
Methods
Connects to the terminal session.
Returns Boolean value of True if successful.
Disconnects from the terminal session.
Returns Boolean value of True if successful.
Finds the starting position of specified subtext, from a specified row and column position, over a specified length of text.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
subtext |
Text |
The text to search for. |
row | Number | The number of the row from which to start searching. |
column | Number | The number of the column from which to start searching. |
length | Number |
The number of characters to search through from the starting point. To search over an unlimited length of text, set the length parameter to 0. |
Returns
Returns the starting position of the first instance of the subtext found as a list in which the first element specifies the row and the second specifies the column at which the instance is located.
Example
The workflow below searches for the text User from position row 5 column 1 across the next 400 characters. The row and column values of the start position of the text is written to the list variable List_Numbers.
In the terminal, the word User is located at position 6/17.
When the workflow is run, the values 6 and 17 are written to the variable List_Numbers, as expected.
Forces the terminal output to conform to a specified number of columns.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
columns | Number | The number of columns to conform to. |
Returns
Returns a number representing the terminal's number of columns after the method has been performed.
Example
The workflow below forces the terminal display to use 100 columns. The number of columns after the method has been performed is written to the variable Var_Num.
The terminal display is resized and the variable Var_Num is set to 100.
Forces the terminal output to conform to a specified number of rows.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
rows | Number | The number of rows to conform to. |
Returns
Returns a number representing the terminal's number of rows after the method has been performed.
Example
The workflow below forces the terminal display to use 40 rows. The number of rows after the method has been performed is written to the variable Var_Num.
The terminal display is resized and the variable Var_Num is set to 40.
Retrieves the position of the cursor on the terminal.
Parameters
No parameters
Returns
Returns a number representing the position of the cursor. See the example to learn how the number is calculated.
Example
The workflow below writes the cursor position to the number variable Num_Var.
The cursor in the example terminal is currently as position 6/17, and there are 80 columns.
The cursor position is calculated as follows:
-
Number of complete rows = (6-1) = 5
-
Number of characters in incomplete row = 17
-
Number of columns per row = 80
-
Cursor position = (5 * 80) + 17 = 417
When the workflow is run, the variable Var_Num is set to 417, as expected.
Retrieves the number of columns in the terminal.
Parameters
No parameters
Returns
Returns the number of columns as a number.
Example
The workflow below writes the number of columns in the terminal display to the number variable Var_Num.
The example terminal currently has 80 columns.
When the workflow is run, Var_Num is set to 80, as expected.
Retrieves text of a specified length from a specified position on the terminal.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
row | Number | The number of the row from which to start retrieving text |
column | Number | The number of the column from which to start retrieving text |
length | Number | The number of characters to return |
Returns
Returns the screen text as text.
Example
The workflow below reads the 3 characters from position 6/17 and writes them to the text variable Var_Text.
The example terminal screen is shown below. The cursor is at position 6/17. The 3 characters from that point are Use.
When the workflow is run, the variable Var_Text is set to Use, as expected.
Resets the terminal.
Parameters
No parameters
Returns
Returns Boolean value of True if successful.
Example
The workflow below resets the terminal and records success or failure in the Boolean variable Var_Bool.
Sends a key to the terminal.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
key | Text | The key to send |
Returns
Returns Boolean value of True if successful.
Example
The workflow below sends the key Z to the terminal and records success or failure in the Boolean variable Var_Bool.
Before the workflow is run, the cursor is located at shown below.
When the workflow is run, the letter Z is entered at the cursor position.
The variable Var_Bool is set to True, indicating success.
Sets the cursor position on the terminal.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
row | Number | The row at which to locate the cursor |
column | Number | The column at which to locate the cursor |
Returns
Returns Boolean value of True if successful.
Example
The workflow below sets the cursor position to row 7 and column 53, and records success or failure in the Boolean variable Var_Bool.
Before the workflow is run, the cursor is at position 6/59 as shown.
When the workflow is run, the cursor is repositioned to 7/53.
The variable Var_Bool is set to True, indicating success.
Writes specified text at a specified position in the terminal. The cursor is not repositioned.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
text | Text | The text to write |
row | Number | The row at which to begin writing the text |
column | Number | The column at which to begin writing the text |
Returns
Returns Boolean value of True if successful.
Example
The workflow below write the text MyProgram at position row 8 column 53, and records success or failure in the Boolean variable Var_Bool.
When the workflow is run, the text is written at the specified location.