## Array Properties and Constants

### Array Properties

Some OCX controls and OLE servers use special types of properties known as 'Array Properties'. These are rather like indexed arrays in APL, in that one or more parameters are used to determine which one of a set of properties you are reading from or writing to. The parameters are often simply integers, but can be strings or other data types.

To use 'Array Properties', you need to use ŚWI rather than dot notation. You pass the parameter(s) as part of the ŚWI argument, and put parentheses into the property name string to indicate this. Each pair of parentheses corresponds to one element from the ŚWI argument list. An example is shown in line 26 of the GetSpreadsheet function above:

        R„XL.name ŚWI 'Range().Value' ('A1:',(śCOLNAMES[COLS]),•ROWS)

`Range` is an Array Property, and the parentheses tell APLX to use one element from the nested argument list (in this case a character vector) as the parameter.

### Constants

Many OCX controls and OLE servers define named constant values or 'enums' as valid arguments for properties and methods. Often the documentation will refer to the names of these constants without giving the values, which you need to use them from APL.

In APLX, there are two ways you can find out these values. The Control Browser window shows constant values by category for controls and servers which publish them. You can thus look up the value in this dialog.

Alternatively, you can determine the value at runtime using the Valueof method. This takes a character vector argument which is the name, and returns the value. For example, Formula One defines a set of enumerated values for file formats. To select the Formula One Version 3 format, you need the constant `F1FileFormulaOne3`. You can either look this up in the documentation, or use the Control Browser to find it, or determine it from within APLX as follows:

         W.F1.Valueof 'F1FileFormulaOne3'
    5

Topic: APLX Help : System Classes : OCX/ActiveX Controls and OLE Automation : Array Properties and Constants

[ Previous | Contents | Index ]