Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : Using COM Objects in ABL : Accessing COM object properties and methods : Property and method syntax : Property name reference
 
Property name reference
This is the syntax to specify a single COM object property:

Syntax

Property-Name [ ( index [ , index ] ... ) ]
[ AS datatype-specifier ]
Property-Name
The name of the COM object property. This name is not case sensitive. But by convention, OpenEdge documentation shows COM object property names in mixed case.
index
Any expression that legally indexes the property and for the required number of dimensions. If necessary and if possible, ABL converts the data type of index to the COM data type expected by the property. Essentially, the syntax is the same as for a method reference with input parameters.
datatype-specifier
One of several data-type specifiers that the associated property might require when you set its value. For more information on datatype, see Table 60. For more information on specifying the AS datatype option and data type conversion for properties, see Specifying options for properties and method parameters.
You can reference a property in two ways:
*Read the property by specifying the appropriate property reference as part of an ABL expression. This expression can be on the right side of an assignment statement or in any other statement that accepts the expression, as in the following bolded expressions:
DEFINE VARIABLE myObject AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE degF     AS INTEGER    NO-UNDO.

/* ... Access COM object as myObject ... */

degF = myObject:TempFahrenheit.
DISPLAY "The current temperature is " myObject:TempFahrenheit " degF.".
*Write (set) the property by specifying the appropriate property reference on the left side of an assignment statement, as in the following bolded property references:
DEFINE VARIABLE myObject AS COM-HANDLE NO-UNDO.

/* ... Access initial COM object as myObject ... */

myObject:SavingsAcount("1000-24-369"):AccountName(1) = "John".
myObject:SavingsAcount("1000-24-369"):AccountName(2) = "Doe".
Note the use of a chained component handle expression to reference a savings account object. AccountName is an indexed property of the SavingsAccount object that specifies a first and last name for the account.