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.
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.
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). |
By default, the PutText methods (PutText1 and PutText2) are set to use Mask mode. You can use the PutTextMaskProtectedField Property to change to LinearStream mode.
The following examples show the differences between using the Mask and LinearStream modes on the following screen.
---------------------------------------------------------------------------------------------- ADDR1 : - ___________________ - CITY: - _________ - ST: - __ - ZIP: - _________ ADDR2 : - 705 5th Ave S -------- CITY: Seattle ---- ST: - WA-ZIP: - 33764-9740 PHONE1: - 555-555-5555 - PHONE2: __________ being cu PWD1=>: ----------------------- PWD2=>: ---------- _____________ d sent in full ---------------------------------------------------------------------------- |
Using PutText2 in Mask mode
This example shows how text is put on the screen when the PutTextMaskProtectedField Property is set to mask mode.
Sub PutTextUsingMaskMode
Dim str As String
str = "This is a test to see if any memo text is being cut off unexpectedly and sent in full"
ThisIbmScreen.PutTextMaskProtectedField = PutTextModeOption_Mask
ThisIbmScreen.PutText2 str, 5, 10
End Sub
The protected fields are masked. The parts of the text string that coincide with the protected fields are skipped and are not placed on the screen.
---------------------------------------------------------------------------------------------- ADDR1 : - This is a test to se - CITY: - y memo tex - ST: - be - ZIP: - t off inex ADDR2 : - 705 5th Ave S --------- CITY: Seattle ---- ST: - WA-ZIP: - 33764-9740 PHONE1: - 555-555-5555 - PHONE2: -being cut off PWD1=>: ----------------------- PWD2=>: ---------d sent in full -------------------------------------------------------------------------- |
Using PutText2 in LinearStream mode
This example shows how text is put on the screen when the PutTextMaskProtectedField Property is set for linear stream mode.
Sub PutTextUsingLinearStreamMode
Dim str As String
str = "This is a test to see if any memo text is being cut off unexpectedly and sent in full"
ThisIbmScreen.PutTextMaskProtectedField = PutTextModeOption_LinearStream
ThisIbmScreen.PutText2 str, 5, 10
End Sub
The protected fields are ignored and the text is pasted into the next unprotected field or hidden field (In this example, the "unexpectedly an" part of the string is put into hidden fields PWD1 and PWD2). All of the text is placed on the screen.
---------------------------------------------------------------------------------------------- ADDR1 : - This is a test to se CITY: - e if any m - ST: - em - ZIP: - o text is ADDR2 : -705 5th Ave S --------- CITY: Seattle e--- ST: - WA-ZIP: - 33764-9740 PHONE1: - 555-555-5555 PHONE2: - being cut off PWD1=>: ----------------------- PWD2=>: --------- d sent in full --------------------------------------------------------------------------- |
For more about using the PutText2 method, see:
Navigating Through Open Systems Sessions
Get Screen Data With an Excel Macro
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.