Show/Hide Toolbars

Inventu Viewer+ .NET Programmer's Reference

Navigation: HostScreen Class > Methods

trySetText Method

Scroll Prev Top Next More

 

Set the value of an unprotected field-- will not throw an exception if the attribute is actually protected based on the context of the active data on the screen.

 

void trySetText(int offset, String value, int length, bool rightAdjust);

 

Arguments

 

HostScreen

 Required. HostScreen object.

 

Offset

 Required. The offset position on the host screen.

 

length

Required - will force padding of the field using the active paddingChar and without use of bounding attributes to determine the length of text to set.  

 

rightAdjust

Required - when true, will right-adjust the data within the length provided.  Use this for right-adjust fields, in conjunction with the length value.

 

Value

 Required. The text string to put into the field.

 

 

Remarks

 

If the offset (or row, col position) is not at the beginning of the field, the text will start at the beginning of the field. The field will be cleared before entering the value.  If the field is not writable, no action is taken and no exception is thrown.

 

The following c# example sets two fields by row and column to their respective parameter values, then sets a system name if available.

 

 bool Signon(HostScreen oScreen, string userID, string pw)

 {

         oScreen.setText(10, 56, userID);

         oScreen.setText(11, 56, pw);

         oScreen.trySetText(1020, "SYS212", 8, false);

         return oScreen.putCommand("[enter]", 30000); // wait up to 30 seconds

 }

 

Requirements

 

Inventu Viewer+

 

See Also

 

mappedSet | putKeys | putCommand | paddingMode | paddingChar | setText

 

Applies To: HostScreen object