SETVALUE Function
Set the content of a field on a 5250 screen to a value. The field may be identified by name or by its order on the screen.
Syntax
Setting by Name - SETVALUE(sVariable , sValue, iIndex)
Parameters
Setting by Name:
sVariable |
Required. String that contains the RAMP field name. |
sValue |
Required. String that contains the value to set the field to. |
iIndex |
Optional. An Integer that specifies the subfile row of the field, for fields that are part of a subfile. Note: the specified row index must exist in the current subfile page. CHECK_FIELD_EXISTS can be used to check whether a particular row exists in the subfile. |
Return Value
None
Remarks
To set a value of a field on a screen by name, the field must have been given a name.
The use of field identification by order is more likely to be impacted by form layout changes than by using a name.
The initial setting of a field by order is more expensive to execute than by name, however screen field order details are cached so that the subsequent access is faster. The caching logic assumes that the relative order of a field on any particular screen will not change within a signed on 5250 session.
Examples
SETVALUE("utxtSignOn", objUser.Name);
SETVALUE("utxtPassword",objUser.Password);
SETVALUE("utxtSelectionOrCommand","90");
SETVALUE("utxtTransaction","MOV");