ScreenUPG
putString Method
Example 



The text to copy to the presentation space.
The row in which to begin writing.
The column in which to begin writing.
Copies a string of text to the specified position in the presentation space and returns the number of characters written.
Syntax
'Declaration
 
Public Function putString( _ 
   ByVal inText As String, _ 
   ByVal inRow As Integer, _ 
   ByVal inColumn As Integer _ 
) As Integer
'Usage
 
Dim instance As ScreenUPG 
Dim inText As String 
Dim inRow As Integer 
Dim inColumn As Integer 
Dim value As Integer 
  
value = instance.putString(inText, inRow, inColumn)
public int putString( 
   string inText,
   int inRow,
   int inColumn 
)
public: 
int putString( 
   String^ inText,
   int inRow,
   int inColumn 
) 

Parameters

inText
The text to copy to the presentation space.
inRow
The row in which to begin writing.
inColumn
The column in which to begin writing.

Return Value

The number of characters written.
Exceptions
ExceptionDescription
InputInhibitedException Thrown if putString was not able to complete successfully because a field with the input inhibited attribute was encountered.
ProtectedFieldException Thrown if putString was not able to complete successfully because a protected field was encountered.
TruncatedException Thrown if there is not enough room in the presentation space to write all of the data specified by putString.
Remarks
Note: putString 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
try
{
	string inText = "a text string";
	int inRow = 1;
	int inColumn = 1;
            
	// Put the text in the presentation space at the home position
	int charsWritten = screen.putString(inText, inRow, inColumn);
}
catch(ProtectedFieldException e)
{
	Console.Write("ProtectedFieldException\n");
}
catch(InputInhibitedException e)
{
	Console.Write("InputInhibitedException\n");
}
catch(TruncatedException e)
{
	Console.Write("TruncatedException " );
}
Dim inText As String
Dim inRow As Integer
Dim inColumn As Integer
Dim charsWritten As Integer
            
'Text to send at home position
inText = "a text string"
inRow = 1
inColumn = 1
            
'Put the text in the presentation space at the home position
charsWritten = screen.putString(inText, inRow, inColumn)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ScreenUPG Class
ScreenUPG Members
putStringEx Method
sendKeys Method