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.

Table Field Operations• Implicitly, by referencing one of the CellAttribute's attributes in your scriptIf they are not already on, the CellAttributes are implicitly turned on whenyour script sets a cell attribute for a cell. For example, the following eventblock changes a cell's background color to red when a user tabs into acolumn. The first time the user enters the specified column, the cellattributes are turned on for that column.on childentry custtable[*].custname =beginfield(custtable[].custname).bgcolor = CC_RED;end;How You Can Use the HasDataChanged AttributeSetting CellAttributes implicitly has the advantage of creatingCellAttributes only when needed. You cannot turn on CellAttributes for thecells of a nested table field.If cell attributes are turned on for a given column field, you can fetch theCellAttribute object for a cell by using the column field CellAttribute method.The following example shows the syntax for fetching the CellAttribute objectthat corresponds to the cell in a column field:cellattribute = columnfield.CellAttribute(record = integer)integerSpecifies the row index of the cellHaving fetched the CellAttribute for a cell, you can use its HasDataChangedattribute to see whether the user has made any changes to the data in thecell. The HasDataChanged attribute is:• TRUE if the user types in an entry field cell or changes a cell of any othertype• FALSE when the value of the cell is changed by a 4GL scriptA 4GL script can also set the HasDataChanged attribute of a CellAttribute, acolumn field, or an entire table field. For example, you might setHasDataChanged to FALSE after processing changes.If you intend to use this attribute, ensure that its information is accurate byturning on the cell attributes explicitly in either of these ways:• In the Property Inspector when you create the frame• By setting the HasCellAttributes attribute when the frame is initialized atruntimeWorking with Arrays, Table Fields, and Collections 247

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

Saved successfully!

Ooh no, something went wrong!