HP 3000 Manuals

BREAK IF [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation


HP Business BASIC/XL Reference Manual

BREAK IF 

The BREAK IF statement provides a general mechanism for automatic summary
level breaks.  The DETAIL LINE statement causes the execution of the
statement.  If the break condition is true, all summary levels from the
BREAK level and up are triggered.  This causes TRAILER and HEADER
sections to be printed.  The BREAK IF statement can occur anywhere in the
report description.  There can only be one BREAK statement per summary
level, either BREAK IF or BREAK WHEN. There is no BREAK statement for the
report level.

Syntax 

BREAK break_level IF boolean_expr 

Parameters 

break_level      The summary level that is triggered if the break
                 condition is satisfied.  This value must be in the range
                 [0, 9]; a level of zero causes the statement to be
                 ignored.

boolean_expr     An expression that evaluates to a numeric value.  If the
                 value is nonzero, a break is triggered at this level.

Examples 

The following examples show the use of the BREAK IF statement.

     100 BREAK 3 IF Abc > Def or Abc < Ghi
     100 BREAK 5 IF Last_name$<> Old_last$ AND &
         First_name$ <> Old_first$

The BEGIN REPORT statement sets all BREAK IF statements to busy, unless
the break_level is zero.  When the report ends, the lines are no longer
busy.  The level expression is evaluated only during BEGIN REPORT. The
Boolean expression is evaluated during DETAIL LINE, TRIGGER BREAK, and
BEGIN REPORT.

The DETAIL LINE statement checks all BREAK statements when its total flag 
is nonzero.  All BREAK statements are checked in this case.  BREAK
statements are evaluated from level one to level nine, in order.  For
BREAK IF, the Boolean expression is evaluated.  If the expression is true
(nonzero), a break is triggered at the given level.  The value of the
LASTBREAK built-in function is changed immediately.  DETAIL LINE
remembers the lowest broken level and triggers all the TRAILER and HEADER
sections from that level through nine.



MPE/iX 5.0 Documentation