10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

VariablesHow You Can Declare Dynamic Array VariablesTo declare an array variable, specify any system class or user class for theobjects associated with the variable. The syntax is:name = array of class [with] default null]The following code is an example:emparray = array of Emp;When you declare an array, it is empty. OpenROAD does not populate thearray automatically. There are a variety of methods that you can use to addrows to an array. For more information, see Working with Arrays, Table Fields,and Collections (see page 205).How You Can Reference Dynamic Array VariablesYou can reference an array as a whole unit or you can reference the individualelements of the array—a single row, a single column, or a single cell.By referencing the array itself, you can work with the entire set of objects as aunit. For example, you can pass the entire array as a parameter to a procedureor you can retrieve a group of rows from a database table into a single array.You can also get information about the array and manipulate the array.To reference an array as a unit, use the array name. For example, assume thatmovies is the name of an array and that you want to pass this array to themovie_list frame. You could use the following statement:callframe movie_list (mv_fld = movies);By referencing an individual row, you can work with an individual object in thearray. To reference an individual row, use the following syntax:arrayname[n]where arrayname is the name of the array in which the row resides and n isthe number of the row. For example, to pass one of the rows from the moviesarray to a procedure:callproc update_row (mv_row = movies[i]);32 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!