The following format is a PowerCOBOL statement used to define the property of a control or a form.
[ " | ' ] PROPERTY-NAME [ " | ' ] [ (INDEX-1 ... ) ] [ OF [ " | ' ] PROPERTY-NAME [ " | ' ] [ (INDEX-1 ... ) ] ] [ OF CONTROL-NAME [ (INDEX-2) ] ] OF { CONTROL-NAME [ (INDEX-2) ] | POW-SELF }
The components of a property definition statement are:
PROPERTY-NAME
There is a pre-defined list of possible properties for each control in PowerCOBOL. For example, the property name for the date style of the displayed TextBox control (named "CmText1") would be written as follows:
"DateStyle" OF "RenderText" OF CmText1
or
"DATESTYLE" OF "RENDERTEXT" OF CMTEXT1
You are not required to write it case-sensitive.
NOTE: If the property name is a COBOL reserved word (e.g. Size, Column, etc.), you must write it using quotation marks. For example, the following is incorrect syntax.
SIZE OF FONT OF CMTEXT1 => Error
For a complete list of properties, refer to the "PowerCOBOL Reference" (online help system).
INDEX-1
When a control has more than one property, each property is identified by an index number or letter combination. The property values can be specified using a literal, for example "TableCells" (1 1) or a variable, for example "TableCells(a b)".
INDEX-2
If controls are organized into an array, a second index number can be used to reference the controls.
CONTROL-NAME | POW-SELF
This is a unique reference to a control or a form. POW-SELF indicates the current form. A few rules must be observed when naming controls and forms to avoid compilation errors:
Controls must have unique names within a form.
Forms must have unique names within a module.
The form name must be unique within an application.
Names must observe COBOL rules for user-defined names, less than 31characters long. Refer to the "NetCOBOL Language Reference" for details.
You cannot select a control or form name that is the same as a form's property or method name.
You cannot define a data name that is the same as a control or form name.
Examples
Standard: "PROPERTY-NAME" OF CONTROL-NAME
Set the string "sample1" to the caption property of the CommandButton control named "Command1".
MOVE "sample1" TO "Caption" OF Command1
Control in array: "PROPERTY-NAME" OF CONTROL-NAME(INDEX)
Set the string "sample2" to the caption property of the third OptionButton control named Option2.
MOVE "sample2" TO "Caption" OF Option2(3)
Control in GroupBox: "PROPERTY-NAME" OF CONTROL-NAME OF GroupBox-control-name
Set the string "sample3" to the caption property of the CheckBox control named Check3 in the GroupBox control named Group1.
MOVE "sample2" TO "Caption" OF Check3 OF Group1