SETVALUE Function

RAMP-NL

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)

Setting by Order - SETVALUE(__Field , sOrder,  sValue)

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. 

 

Setting by Order:                                

__Field

Special value __Field (with two underscores) indicates that a field (ie: a simple text area) on the form is to be set.

sOrder

The order of the field on the form starting from 1. Special values __Last and __First (again with two underscores) may be used.  Note the order is that of the fields on the form, not of all the controls on the form (eg: labels, combo boxes, etc).      

sValue

Required. String that contains the value to set the field to. 

 

Return Value

None

Remarks

To set a value of a field on a screen by name, the field must be given a name in the newlook Designer.

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");

 

SETVALUE(__Field,__First,"xxx"); /* Set first field */

 

SETVALUE(__Field,__Last,"7.45"); /* Set last field */

 

SETVALUE(__Field,1,"Hello World"); /* Set field number 1 */

 

SETVALUE(__Field,6,"ADM"); /* Set field number 6 */