Try OpenEdge Now
skip to main content
Programming Interfaces
COM Object Data Type Mapping : Conversions from ABL to COM data types : ABL to COM data type features and limitations : Array conversions
 
Array conversions
ABL supports conversions between COM Array data types and ABL arrays (data types with extents like AS INTEGER EXTENT 5.) The conversion for arrays follows the conversions listed in Table 74.
In addition, COM arrays, including those returned from methods and properties of ActiveX or Automation objects, can be used in ABL anywhere an ABL EXTENT object is permitted. For example:
dateArray = ComObj:GetHolidays().

comObj:Holidays = dateArray.

ComObj:SetDates(ComObj2:GetHolidays()).

RUN SetDates(ComObj2:GetHolidays()).
Note: Attempting to assign a COM array of Variants, where the Variants are not a homogeneous type results in a runtime error.
The COM object viewer will show the return value of a method or property that returns an array as [ <type>-Array = ] rather than as [ <type>-Var = ]. For example:
[ Integer-Array = ] <com-handle>: retIntArray ( ).

[ Date-Array = ] <com-handle>: Dates.
You also cannot get or set the value of an individual COM array element without first storing the entire array into an ABL EXTENT variable. For example, each of the following will result in a runtime error:
dtXmas = ComObj:Holidays[2].

ComObj:Holidays[2] = dtXmas.

carModel = ComObj:Cars[1]:Model.