InfoConnect API Guide
Attachmate.Reflection.Emulation.IbmHosts Namespace / IIbmScreen Interface / PutText Method / PutText(String,Int32,Int32,Int32) Method
Text to put on screen.
Row position on which to put the text.
Column position on which to put the text.

Number of byte positions available for the text. If the text string is longer than "length", the text is truncated. Text can span more than one field.



In This Topic
    PutText(String,Int32,Int32,Int32) Method
    In This Topic

    Puts text at a specified screen location, taking up the number of characters specified by the length parameter. PutText 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 or the specified length is exceeded.

    Syntax
    'Declaration
     
    
    Overloads Function PutText( _
       ByVal text As String, _
       ByVal row As Integer, _
       ByVal column As Integer, _
       ByVal length As Integer _
    ) As ReturnCode
    'Usage
     
    
    Dim instance As IIbmScreen
    Dim text As String
    Dim row As Integer
    Dim column As Integer
    Dim length As Integer
    Dim value As ReturnCode
     
    value = instance.PutText(text, row, column, length)

    Parameters

    text
    Text to put on screen.
    row
    Row position on which to put the text.
    column
    Column position on which to put the text.
    length

    Number of byte positions available for the text. If the text string is longer than "length", the text is truncated. Text can span more than one field.

    Return Value

    ReturnCode indicates success, failure, or a warning condition if the cursor position reaches the screen boundary.
    Exceptions
    ExceptionDescription
    This exception is thrown if the row or column parameters are outside the range of valid values: (1 to Rows) or (1 to Columns).
    Remarks

    The following examples show the differences between the 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 PutText methods in Mask mode

    This example shows how PutText pastes text into a screen when PutTextMaskProtectedField is set to mask.

    ....

    IFrame frame = (IFrame)app.GetObject("Frame");
    frame.CreateView(terminal);

    string str = "This is a test to see if any memo text is being cut off unexpectedly and sent in full";

    IIbmScreen screen = terminal.Screen;
    screen.PutTextMaskProtectedField = PutTextModeOption.Mask;
    screen.PutText(str, 5, 10, 85);

    ....

    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

    string str = "This is a test to see if any memo text is being cut off unexpectedly and sent in full";PWD1=>: ----------------------- PWD2=>: ---------d sent in full

    --------------------------------------------------------------------------

    Using PutText methods in LinearStream mode

    This example shows how the PutText method pastes text into a screen when PutTextMaskProtectedField is set to LinearStream.

    ....

    IFrame frame = (IFrame)app.GetObject("Frame");
    frame.CreateView(terminal);

    string str = "This is a test to see if any memo text is being cut off unexpectedly and sent in full";

    IIbmScreen screen = terminal.Screen;
    screen.PutTextMaskProtectedField = PutTextModeOption.LinearStream;
    screen.PutText(str, 5, 10, 85);

    ....

    The protected fields are ignored and the text is pasted into the next unprotected 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-5555PHONE2: - being cut off

    PWD1=>: ----------------------- PWD2=>: --------- d sent in full

    ---------------------------------------------------------------------------

    See Also