Top
PowerCOBOL V11.0 User's Guide
FUJITSU Software

5.4.4 Manipulating Control Properties

The following statements can also be used to change a control's property:

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.

5.4.4.1 MOVE Statement

Use the MOVE statement to change the value of a control's property.

5.4.4.1.1 Syntax
MOVE SEND-CONTROL TO CONTROL-PROPERTY
5.4.4.1.2 Syntax and Usage Rules

Refer to the "NetCOBOL Language Reference" for additional information.

5.4.4.1.3 Example

Change the displayed text of the string display control (TEXT-STRING) into "PowerCOBOL".

MOVE   "PowerCOBOL"   TO   "Caption" OF TEXT-STRING.

5.4.4.2 ADD Statement

Use the ADD statement to increase the numeric value of a control's property.

5.4.4.2.1 Syntax
ADD {CONSTANT | DATA-NAME} TO CONTROL-PROPERTY
     [END-ADD]
5.4.4.2.2 Syntax and Usage Rules

Refer to the "NetCOBOL Language Reference" for additional information.

5.4.4.2.3 Example

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.                         

5.4.4.3 SUBTRACT Statement

Use the SUBTRACT statement to decrease the numeric value of a control's property.

5.4.4.3.1 Syntax
SUBTRACT DATA-NAME FROM CONTROL-PROPERTY
    [END-SUBTRACT]
5.4.4.3.2 Syntax and Usage Rules

Refer to the "NetCOBOL Language Reference" for additional information.

5.4.4.3.3 Example

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.                         

5.4.4.4 COMPUTE Statement

The COMPUTE statement is used to calculate the numeric value of a control using the numeric value of another.

5.4.4.4.1 Syntax
COMPUTE  Unique-Data-Name  =  Arithmetic-formula
5.4.4.4.2 Syntax and Usage Rules

Refer to the "NetCOBOL Language Reference" for additional information.

5.4.4.4.3 Example

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