10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

External ClassesThe following code is an OpenROAD collection example, which is discussed inthe paragraphs that follow:x = sheets;x1 = sheets a collection of cells;y = cell;x.item(1)= y;x1[1] = y;In the preceding example, x and x1 are declared as reference variables of thesheets class type. Sheets is an external class that is actually an ActiveXcollection. This collection contains objects of the cells class type. The x1variable is also qualified as an OpenROAD collection. The y variable is declaredas a reference variable of the cell class type. The syntax for indexing into theActiveX collection depends on how the variables are declared. OpenROAD arraysyntax can be used if the variable is qualified as an OpenROAD collection.Otherwise, the collection is indexed using the standard item method.The following code shows the indexing of a collection using array syntax:y = cell;x = sheets a collection of cells;x[1]=y;If the reference variables are declared as follows:y = cell;x = sheetsx1 = sheets a collection of cells;Then the following statements are wrong and will fail:x[1] = cells;x1.item(1) = cells;However, the following statements are correct:x.item(1) = cell;x1[1] = cell;For more information about collections, see Collections (see page 254).Working with Classes 137

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!