Declaring statements to be executed on starting field value(s)

!on starting

Declare statements to be executed on starting field value(s)


SYNTAX

!on starting field_id [and|or field_id] {
 statements
}

Declare a block of statements to be executed if the controlling expression changes value at the start of a cycle. The statements are executed before the main code section but after the new set of records has been read and all automatic temps calculated.

Each field_id must be a field from the driving file, an automatically read cross reference file, or an automatic temp. These are declared by !drive, !xfile and !auto, respectively. If more than one controlling field is specified, the fields must be linked by the same operator - and or or. These two operators cannot be mixed in a single !on starting expression.

Any number of !on starting declarations are permitted. They are processed in the order in which they are defined.

Functions such as total, min, max, average and count, if called in an !on starting section, return values from the start of the report to the end of the previous cycle.


NOTES

  • Subscripts cannot be specified for a field_id in an !on starting declaration. Therefore, if field_id is subscripted, the first element (in every dimension) is the element checked.


EXAMPLES

!on starting Stock.cat and Stock.code {
     newpage
}

!on starting Stock.cat {
     print lns(2)
     StartNewCategory()
}

RELATED TOPICS

Reports

!on ending