O -- Logic Commands

OnChange

Specifies control breaks in reports. A footer and a header are invoked whenever the value of the controlling variable changes. This variable can be any persistent or non-persistent report attribute.

ONCHANGE variable AS literal FOOTING report_name [ AT number ] HEADING report_name
 [ AT number ] [  <routine_call> ]

 <routine_call> := routine variable GIVING variable
Option Description

variable

The controlling variable.

AS literal

String which is placed into Glb.Change. GLB.CHANGE is assigned the value of the As operand when that particular change is triggered by a change in the specified attribute.

(FOOTING or FTG) report_name

Specifies a report frame as the footer.

AT number (first)

Specifies the line number to start the report footer.

(HEADING or HDG) report_name

Specifies the qualifier, a report frame, as the header.

AT number (second)

Specifies the line number to start the report header.

routine_call

A statistical routine to invoke, which can be one of Count (CNT), Maximum (MAX), Minimum (MIN), Sum (SUM), SumSquares (SSQ), Average (AVG or MEAN), MeanSquares (MSQ), Variance (VAR), or StdDeviation (STD).

routine variable

The source variable used by the statistical routine as the basis of its computation.

(GIVING or GIV) variable

Directs the result of the computation to the specified variable.

Otherwise

Specifies the default behavior of a case statement. It specifies the logic to execute when no other case conditions apply. Case, Otherwise, Else, EndCase are not standalone commands and the syntaxes are included along with the BeginCase command.