PutText2 Method (IbmScreen)
Puts text at a specified screen location. PutText2 has two modes: Mask and LinearStream. These modes are set with the PutTextMaskProtectedField Property.
In Mask mode (the default), text that coincides with protected fields is skipped and is not placed on the screen.
In LinearStream mode, protected fields are ignored and the text is placed sequentially in unprotected fields until all of the text is placed on the screen.
expression.PutText2( _
ByVal As String, _
ByVal As Integer, _
ByVal column As Integer _
) As ReturnCode
where
expression is a variable that represents a
IbmScreen Object
Parameters
- text
- The text to place on the screen.
- row
- The row of the screen location to put the text in.
- column
- The column of the screen location to put the text in.
Return Value
One of the following ReturnCode enum values.
Member |
Description |
Cancelled |
Cancelled. |
Error |
Error. |
PermissionRequired |
Permission is required. |
Success |
Success. |
Timeout |
Timeout condition. |
Truncated |
The text is truncated. |
Exception | Description |
ArgumentOutOfRangeException |
This exception is thrown if the row or column parameters are outside the range of valid values: (1 to Rows) or (1 to Columns).
|
This example enters a user name and prompts for a password after the session connects.
To run this sample, copy the code to the ThisIbmTerminal code window.
Private Sub IbmTerminal_AfterConnect(ByVal sender As Variant)
Dim rcode As ReturnCode
Dim pw As String
'Prompt for a password
pw = ThisIbmTerminal.Macro.PasswordBox("enter your password", "password")
'Move the cursor to the user name field and put the user id in that field
rcode = ThisIbmScreen.MoveCursorTo1(20, 16)
rcode = ThisIbmScreen.PutText2("userid", 20, 16)
'Put the password in the password field
rcode = ThisIbmScreen.PutText2(pw, 21, 16)
'Enter the user ID and password
ThisIbmScreen.SendControlKey ControlKeyCode_Transmit
End Sub