Some ActiveX controls are designed with multiple (object) interfaces. For example, "Microsoft Chart Control, version 6.0 (OLEDB)" has 42 public interfaces. Each interface is equivalent to a new object definition. In order to access the full feature set of the Microsoft Chart control, ACUCOBOL-GT must allow the property modification and method invocation of 42 different objects. For example, to set the Microsoft Chart 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.
Here's how you would set the text and backdrop parameters for a chart legend in Visual Basic.
Private Sub Command1_Click() With MSChart1.Legend ' Make Legend Visible. .Location.Visible = True .Location.LocationType = VtChLocationTypeRight ' Set Legend properties. .TextLayout.HorzAlignment = _ VtHorizontalAlignmentRight ' Right justify. ' Use Yellow text. .VtFont.VtColor.Set 255, 255, 0 .Backdrop.Fill.Style = VtFillStyleBrush .Backdrop.Fill.Brush.Style = VtBrushStyleSolid .Backdrop.Fill.Brush.FillColor.Set 255, 0, 255 End With End Sub
In ACUCOBOL-GT this task is accomplished in a similar way with the USE verb, "^" and "::" operators. For example:
MODIFY MS-CHART-1 Legend::Location::Visible = 1. MODIFY MS-CHART-1 Legend::Location::LocationType = VtChLocationTypeRight. MODIFY MS-CHART-1 Legend::TextLayout::HorzAlignment = VtHorizontalAlignmentRight. MODIFY MS-CHART-1 Legend::VtFont::VtColor:: Set ( 255, 255, 0 ). MODIFY MS-CHART-1 Legend::BackDrop::Fill::Style = VtFillStyleBrush. MODIFY MS-CHART-1 Legend::BackDrop::Fill::Brush::Style = VtBrushStyleSolid. MODIFY MS-CHART-1 Legend::BackDrop::Fill::Brush::FillColor:: Set ( 255, 0, 255 ).
or:
USE MS-CHART-1 Legend MODIFY ^Location::Visible = 1 ^Location::LocationType = VtChLocationTypeRight ^TextLayout::HorzAlignment = VtHorizontalAlignmentRight ^VtFont::VtColor::Set ( 255, 255, 0 ) ^BackDrop::Fill::Style = VtFillStyleBrush ^BackDrop::Fill::Brush::Style = VtBrushStyleSolid ^BackDrop::Fill::Brush::FillColor:: Set ( 255, 0, 255 ) END-USE
This syntax can be described as follows. In this format, the word following MODIFY must always be a control handle or "^". Each property or method name can be followed by "::" and then another property or method name to invoke methods inline. "MethodName1::MethodName2" means invoke the method "MethodName1" of the current object and set the current object to the return value. When a property or method name is followed by a token other than '::', then it means to actually invoke the method on the current object passing the specified arguments or set the property to the specified value and reset the current object to null.
For example, the following code:
MODIFY MS-CHART-1 Legend::BackDrop::Fill::Brush::FillColor:: Set ( 255, 0, 255 ).
can be broken down as follows:
MODIFY MS-CHART-1 Legend :: BackDrop :: Fill :: Brush :: FillColor :: Set ( 255, 0, 255 ).
which means MODIFY MS-CHART-1 in the following ways: