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.

ArraysThere are five valid row states:RS_UNDEFINEDIndicates that:• A row was automatically added to the end of an array when a user, ina table field, set the input focus to the row just beyond the last row orused the down arrow key to move past the last row.• A user selected the Insert Before Current Row operation from a tablefield's default control button. A row whose state is RS_UNDEFINEDcannot change to a state of RS_DELETED. When these rows aredeleted by any means, they disappear from the array.RS_NEWOccurs when a user types in or otherwise changes an undefined(RS_UNDEFINED) row.A row whose state is RS_NEW cannot change to a state of RS_DELETED.When these rows are deleted by any means, they disappear from thearray.RS_UNCHANGEDIndicates a row that was added to the array by a 4GL script (by theInsertRow method or assignment statement) and has not yet beenchanged by the user.RS_CHANGEDOccurs when a user makes a change, other than a deletion, to anRS_UNCHANGED row. If the user changes the data and then sets it back toits original value, the row's state remains RS_CHANGED.RS_DELETEDIndicates a row that was initially RS_UNCHANGED or RS_CHANGED andthen was marked deleted, either by the program (using the SetRowDeletedmethod) or by a user (using the table field control button's Delete CurrentRow or Delete All Rows operation).A row that has the state RS_DELETED remains in the array with a nonpositiverow number.You can force a row to reflect a different state than would occur by default bydirectly assigning a value to the _RowState attribute. For example, assume aframe remains open after the user clicks the Save button. This frame lets theuser continue making changes to values in a table field after saving existingchanges. To prevent the same changes from being written to the database thenext time the user clicks the Save button, you can set the state of all rowsback to RS_UNCHANGED. The following code fragment checks the row state ofevery row in the custtable array, makes appropriate changes to the database,and resets the value of all row states to RS_CHANGED:Working with Arrays, Table Fields, and Collections 213

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

Saved successfully!

Ooh no, something went wrong!