The following statements can also be used to change a control's property:
MOVE
ADD
SUBTRACT
COMPUTE
No other statements can be used. The following sections contain descriptions of these statements and how to use them to change the properties of a control.
MOVE SEND-CONTROL TO CONTROL-PROPERTY
The 'send-control' must be a constant or a data name.
Only one 'control-property' can be identified per MOVE statement.
The CORRESPONDING statement cannot be used with a MOVE statement.
Refer to the "NetCOBOL Language Reference" for additional information.
Change the displayed text of the string display control (TEXT-STRING) into "PowerCOBOL".
MOVE "PowerCOBOL" TO "Caption" OF TEXT-STRING.
ADD {CONSTANT | DATA-NAME} TO CONTROL-PROPERTY
[END-ADD]
No more than one control can come before or after the TO statement.
The ON SIZE ERROR and NOT ON SIZE ERROR clauses cannot be used with the ADD statement.
The GIVING statement cannot be used with the ADD statement.
The CORRESPONDING statement cannot be used with the ADD statement.
Refer to the "NetCOBOL Language Reference" for additional information.
The TIMER event procedure of the timer control.
: PROCEDURE DIVISION. : ADD 10 TO "Interval" OF CmTimer1. IF "Interval" OF CmTimer1 > 100 Move 10 To "Interval" OF CmTimer1 END-IF.
SUBTRACT DATA-NAME FROM CONTROL-PROPERTY
[END-SUBTRACT]
No more than one control can come before or after the FROM statement.
The ON SIZE ERROR and NOT ON SIZE ERROR statements cannot be used with the SUBTRACT statement.
The GIVING statement cannot be used with the SUBTRACT statement.
The CORRESPONDING statement cannot be used with the SUBTRACT statement.
Refer to the "NetCOBOL Language Reference" for additional information.
The TIMER event procedure of the timer control.
: PROCEDURE DIVISION. : SUBTRACT 10 FROM "Interval" OF CmTimer1. IF "Interval" OF CmTimer1 < 100 Move 100 To "Interval" OF CmTimer1 END-IF.
The COMPUTE statement is used to calculate the numeric value of a control using the numeric value of another.
COMPUTE Unique-Data-Name = Arithmetic-formula
A property may be included in an Arithmetic-Formula.
Only a single data name (i.e. "Unique-Data-Name") may be specified in the receiving field.
Refer to the "NetCOBOL Language Reference" for additional information.
Set the font size of Static text control (CmStatic1) to be 2 points larger than the font size of CommandButton control (CmCommand1).
DATA DIVISION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. ... COMPUTE "Size" OF "Font" OF CmStatic1 = "Size" OF "Font" OF CmCommand1 + 2