Testing Whether Data on the Current Row of the Scrollable Region Has Been Altered

To determine if the data in any field on the current row of the scrollable region has been altered, use sr_rowisaltered():

int sr_rowisaltered(srp)

SRPTR srp;                /* Scrollable region                */

sr_rowisaltered() returns a TRUE if any field has been altered on the current row and FALSE if no field has been altered. Note that a field is considered altered if the user inserts, deletes, or overwrites the field entry, even if the user edits it back to the original value. Also, if the user selects the current value of the field from a choice list, the field would also be considered altered; this is because the system automatically copies the current choice list item to the field even if it overwrites the same value.

Once the row is considered altered, it remains as such until the row has been converted either by you or by the editor when the row scrolls out of view on the form.

You can use sr_rowisaltered() in field validation functions, end-field functions, and end-row functions. Do not use sr_rowisaltered() in end-scrollable region functions or end-form functions; the data has already been validated and placed into the data variables, and the flag that indicates whether the field has been altered has been reset.


Home Contents Previous Next