{ property-name } {IS } { prop-option [GIVING result-1] }... { PROPERTY property-type } {ARE} { method-name } {= } { object-expression }
where prop-option is one of the following:
{ property-value [ LENGTH {IS} length-1 ] } { {= } } { ) { ( {property-value} ... ) } { } { { MULTIPLE } property-table } { { TABLE } } { } { parameter } { } { ( { parameter } ... ) }
For example, the MAX-TEXT special property of entry fields is property number 1. You can set the value of this property to 10 with either of the following phrases:
PROPERTY 1 = 10 MAX-TEXT = 10
The second method can be used only when your code makes it clear to the compiler that you're acting on an entry field.
You can use either the PROPERTY phrase or method-name to specify which method to invoke. For example, the LoadFile method of the Microsoft Rich Textbox Control is method number 37. You can invoke this method with either of the following phrases:
PROPERTY 37 ("myfile.rtf", rtfRtf) LoadFile ("myfile.rtf", rtfRtf)
The second method can be used only when your code makes it clear to the compiler that you're acting on a Microsoft Rich Textbox Control.
When you specify property-table, then each element of the table is assigned to the property. The elements are assigned in ascending occurrence order. For example, the following code fragment fills a list box with the names of three colors:
01 COLOR-NAMES. 03 PIC X(10) VALUE "Red". 03 PIC X(10) VALUE "Green". 03 PIC X(10) VALUE "Blue". 01 COLOR-TABLE REDEFINES COLOR-NAMES OCCURS 3 TIMES PIC X(10). PROCEDURE DIVISION. MAIN-LOGIC. DISPLAY LIST-BOX, SIZE 10, LINES 3, ITEM-TO-ADD = TABLE COLOR-TABLE.
You should use caution when specifying property tables in the Screen Section. Remember that each DISPLAY statement of a Screen Section item reloads all of that item's properties into the control. This can be inefficient if the property table is large, and it can cause duplicate entries if you are not careful. To avoid this, you can create your controls in the Screen Section, but use the MODIFY statement to set any table-oriented properties at the appropriate point in your program. In this way, the tables are not referenced in the Screen Section and a DISPLAY will not cause those tables to be reprocessed.
DataGrid::RowLabel( ROW-NUMBER, ROW-LABEL-INDEX, "My Row Label" )
{ {^} property-1 [ ( param-1 ... ) ] [ :: property-2 [ ( param-2 ... ) ] ]... }
object-expression specifies a property or method of an object referenced by another object. This object in turn can be referenced by yet another object. The "root" object can be an ActiveX control or COM object or a graphical control. "^" can only be used in conjunction with Format 5 USE verb (see the documentation for the USE verb for more information). property-1 is the name of a property of the ActiveX control or COM object. property-1 must not be a write-only property. property-2 is the name of a property of the ActiveX control or COM object which is the value of property-1. property-2 must not be a write-only property. param-1 and param-2 are literals, data items or numeric expressions. param-1 is the first parameter passed when getting the value of property-1 and param-2 is the first parameter passed when getting the value of property-2.
For example, to set the Microsoft Chart Control legend, you get the value of the Legend property. This value is an object that you may then modify to change the legend. The Legend object has properties whose values are other objects, and so on. The following phrases set properties and invoke methods of the Microsoft Chart Legend object:
Legend::Location::Visible = 1 Legend::Location::LocationType = VtChLocationTypeRight Legend::TextLayout::HorzAlignment = VtHorizontalAlignmentRight Legend::VtFont::VtColor::Set (255, 255, 0) Legend::BackDrop::Fill::Style = VtFillStyleBrush Legend::BackDrop::Fill::Brush::Style = VtBrushStyleSolid Legend::BackDrop::Fill::Brush::FillColor::Set (255, 0, 255)
or assuming the handle to the Microsoft Chart Control is MS-CHART-1:
USE MS-CHART-1 Legend MODIFY ^Location::Visible = 1 ^Location::LocationType = VtChLocationTypeRight ^TextLayout::HorzAlignment = VtHorizontalAlignmentRight ^VtFont::VtColor::Set ( 255, 255, 0 ). USE MS-CHART-1 Legend::BackDrop::Fill MODIFY ^Style = VtFillStyleBrush ^Brush::Style = VtBrushStyleSolid ^Brush::FillColor::Set ( 255, 0, 255 ).