SetValue Method

RAMP-NL

SetValue Method


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

Define_Com Class(#vf_sy122) Name(#myscreen_wrapper) Parent(#COM_OWNER)

Setting by Name - #myscreen_wrapper.setvalue Infield(sField) Value(vValue)

Parameters

Setting by Name:

InField

Char 256 – Required

String that contains the RAMP field name. 

Value

Variant – Required

String or number that contains the value to set the field to. 

 

Setting by Order:      

InField

Property - Required

<#myscreen_wrapper>.ByOrder_Field

Value

Variant – Required

String or number that contains the value to set the field to.

SpecialValue

Property – Optional

One of these two values:

<#myscreen_wrapper>.First_Field – to set the value of the first field on the screen

<#myscreen_wrapper>.Last_Field – to set the value of the last field on the screen

Order

Integer – Optional

The order of the field on the form starting from 1. 

 

Return Value

None

Remarks

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

The use of field identification by order is more likely to be impacted by form layout changes than when 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

Define_Com Class(#vf_sy122) Name(#myscreen_wrapper) Parent(#COM_OWNER)

Setting by Name - #myscreen_wrapper.setvalue Infield('uEmpno') Value(#EMPNO)

Setting by Order - #myscreen_wrapper.setvalue Infield(#myscreen_wrapper.ByOrder_Field) Value(#Empno) Order(2)