Release 10.1A: OpenEdge Development:
Programming Interfaces

> ## Restrictions on property and method references

> Progress supports most features necessary to reference COM object properties and methods. However, there are some restrictions:

> - Parentheses are required for method calls, whether or not they take parameters.

> - There is no support for named (keyword) parameters.

> - There is no support for default properties or methods.

> ##### Parentheses on method calls

> In general, you must specify all method references with parentheses. Although some COM objects accept a method call referenced without parentheses, Progress is not aware that such a reference is a method call. Without parentheses, the compiler interprets the reference as a property rather than as a method. This can cause unpredictable results for the method call.

> ##### Named method parameters

> The COM standard allows named method parameters that you can specify in any order for a method call. Progress does not support named parameters in any form. The first line of this example shows an illegal named parameter, where the Filename parameter is passed to the SaveAs method on an Excel Workbook handle:

>     Excel-Workbook-hdl:SaveAs (Filename = "x.xls"). /* Illegal syntax */
>     Excel-Workbook-hdl:SaveAs ("x.xls").            /* Legal syntax */

> The second line shows the form that Progress accepts. In general, whether or not you omit optional parameters, you must pass all method parameters in the correct parenthesized order.

> ##### Default properties and methods

> The COM standard allows for default properties and methods. For any COM object, the default property or method is invoked when you reference only the COM object handle. For example, Item is the default (indexed) property for collection objects. However, Progress requires that you specify all properties and methods you want to reference, whether or not they are defaults for the COM object:

>     DEFINE VARIABLE hCollection AS COM-HANDLE.

>     /* ... Set hCollection to a collection COM object ... */

>     hCollection:Item(1). /* This is legal in Progress. */
>     hCollection(1).     /* This is not legal in Progress. */

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095