Copies a string of text to the specified position in the presentation space and returns the number of characters written.


Namespace: ScreenUPG
Assembly: ScreenUPG (in ScreenUPG.dll)

Syntax

Visual Basic (Declaration)
Public Function putStringEx( _ 
   ByVal inText As String,  _ 
   ByVal inStartRow As Integer,  _ 
   ByVal inStartColumn As Integer,  _ 
   ByVal inEndRow As Integer,  _ 
   ByVal inEndColumn As Integer,  _ 
   ByVal inArea As Integer,  _ 
   ByVal inWrap As Integer,  _ 
   ByVal inModes As Integer,  _ 
   ByVal inFill As Boolean _ 
) As Integer
C#
public int putStringEx(
   string inText,
   int inStartRow,
   int inStartColumn,
   int inEndRow,
   int inEndColumn,
   int inArea,
   int inWrap,
   int inModes,
   bool inFill
)
C++
public:
 int putStringEx(
   String inText,
   int inStartRow,
   int inStartColumn,
   int inEndRow,
   int inEndColumn,
   int inArea,
   int inWrap,
   int inModes,
   bool inFill
) sealed 
J#
public int putStringEx(
   string inText,
   int inStartRow,
   int inStartColumn,
   int inEndRow,
   int inEndColumn,
   int inArea,
   int inWrap,
   int inModes,
   bool inFill
)
JScript
public  function putStringEx(
   inText : String,
   inStartRow : int,
   inStartColumn : int,
   inEndRow : int,
   inEndColumn : int,
   inArea : int,
   inWrap : int,
   inModes : int,
   inFill : bool
) : int

Parameters

inText
The text to copy to the presentation space.
inStartRow
The row in which to begin writing.
inStartColumn
The column in which to begin writing.
inEndRow
The row at which to stop writing.
inEndColumn
The column at which to stop writing.
inArea
Reserved. Set to 0.
inWrap
Whether or not to wrap to the top after reaching the end of the presentation space. Possible values include: WRAP_ON and WRAP_OFF
inModes
Action to perform when a protected field is encountered while writing the string to the presentation space. Possible values include: PUTSTRING_SKIP, PUTSTRING_SPAN and PUTSTRING_STOP.
inFill
When true, the area specified is filled with the string specified by inText.

Return Value

The number of characters written.

Exceptions

Exception TypeCondition
T:InputInhibitedException Thrown if putStringEx was not able to complete successfully because a field with the input inhibited attribute was encountered.
T:ProtectedFieldException Thrown if putStringEx was not able to complete successfully because a protected field was encountered.
T:TruncatedException Thrown if there is not enough room in the presentation space to write all of the data specified by putString.

Remarks

Note: putStringEx only copies text (not keystrokes) to the presentation space and will overwrite any existing text. It is not affected by enabling Insert mode. To send keystrokes (such as Transmit or Tab) or to insert characters use sendKeys.

Example

[C#]

 Copy Code
            try
            {
                string inText = "a text string";
                int inStartRow = 1;
                int inStartColumn = 1;
                int inEndRow = 24;
                int inEndColumng = 80;
                int inArea = 0;
                int inWrap = ScreenUPG.ScreenUPG.WRAP_ON;
                int inMode = ScreenUPG.ScreenUPG.PUTSTRING_STOP;
                bool inFill = true;
            
                // Fill the presentation space, starting at the home position with the text
                int charsWritten = screen.putStringEx(inText, inStartRow, inStartColumn, inEndRow, inEndColumn, inArea, inWrap, inMode, inFill);
            }
            catch(ProtectedFieldException e)
            {
                Console.Write("ProtectedFieldException\n");
            }
            catch(InputInhibitedException e)
            {
                Console.Write("InputInhibitedException\n");
            }
            catch(TruncatedException e)
            {
                Console.Write("TruncatedException\n");
            }
            
[VB]
 Copy Code
            Dim inText As String
            Dim inStartRow As Integer
            Dim inStartColumn As Integer
            Dim inEndRow As Integer
            Dim inEndColumn As Integer
            Dim inArea As Integer
            Dim inWrap As Integer
            Dim inMode As Integer
            Dim inFill As Boolean
            Dim charsWritten As Integer
            
            'Text to send at home position
            inText = "a text string"
            inStartRow = 1
            inStartColumn = 1
            inEndRow = 24
            inEndColumn = 80
            inArea = 0
            inWrap = 1
            inMode = 0
            inFill = True
            
            'Fill the presentation space, starting at the home position with the text
            charsWritten = screen.putStringEx(inText, inStartRow, inStartColumn, inEndRow, inEndColumn, inArea, inWrap, inMode, inFill)
            

See Also