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.

ArraysThis method only allows rows to be added to the end of an array or to anempty array. Also, the index must be incremented by one; this method doesnot work if row numbers are skipped.When you use this method to add rows to an array that is displayed in a tablefield, OpenROAD updates the display when the event block containing theselect loop completes.Use the InsertRow Method of the ArrayObject ClassThe syntax for this method is:integer = arrayname.InsertRow([rownumber = integer][, rowobject = object] [,_rowstate = integer]);arraynameobjectSpecifies the name of the arraySpecifies a reference variable that points to an object that is either of thesame class as, or is a subclass of, the array's class. When the statement isexecuted, OpenROAD inserts the object into the array at the specifiedposition.If you do not specify an object, OpenROAD constructs an object whoseattributes contain default values and inserts the object into the array.Default values are null for nullable fields, zero for numeric fields andblanks for character fields.Another way to set default values for a column is by setting default valuesfor the ProtoField of the column. For more information, see TableField,ColumnField, and ProtoField Objects (see page 228).The InsertRow method inserts the new row ahead of the row specified by therownumber parameter and adjusts the numbers of the rows following the newrow. For example, if you insert a row into the third row position in the array,the current row 3 becomes row 4. If you do not specify the rownumberparameter, OpenROAD inserts the new row as row 1. To insert a row at theend of the array, set rownumber = arrayname.LastRow+1.By setting _rowstate, you can set the _rowstate to other than the defaultRS_CHANGED.Inserting a default object is the best way to insert an empty row into an array.For example, the following code inserts a blank row at the specified position:custtable.InsertRow(rownumber = row);Working with Arrays, Table Fields, and Collections 217

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

Saved successfully!

Ooh no, something went wrong!