HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

4- 10
negative. If SALES has an initial value of 480, the break limit is set
to 450 (not 430). If SALES gets larger, no break ever occurs. Only when
SALES becomes 450 or less does the break occur. For example, if SALES
drops to 220, a break occurs and the new limit is set to 200. It is
important to remember that this is the multiple of a BY clause.
Control Expression Storage Requirements
The control expression for BREAK WHEN statements is kept by the OLDCV
function. The data space required to contain this expression is
determined during BEGIN REPORT, when the values are first examined. The
space for OLDCV and OLDCV$ are allocated as follows:
* For numeric variables and array elements, space is allocated based on
the data type of the variable. There should be no way to get an
error with OLDCV in this case.
* For other numeric space is allocated based on the data type returned
when the expression is initially examined. Thus, if BEGIN REPORT
finds an INTEGER expression, space is allocated for an INTEGER. If
the expression later returns a REAL outside the INTEGER range, an
error occurs.
* For other string variables and array elements, space for OLDCV$ is
allocated based on the maximum length of the string variable. Thus,
the value of the string may be shorter than the space allocated.
* For string expressions including substrings, space for OLDCV$ is
allocated based on the actual length of the evaluated expression.
This could cause a string overflow if a later evaluation returns a
longer string.
A BY clause stores two values: the BY value itself, and the limit, which
causes a break. Both of these values are stored in REAL or DECIMAL,
depending on the option in the report subunit.
CALL
The CALL statement transfers control from the program unit that the
statement occurs in to a specified subprogram. The subprogram that
control is transferred to must be defined in the program or a run-time
error occurs.
The CALL statement can also transfer control to a user-defined multi-line
function. When used in this manner, the function is actually called as a
subprogram. The value returned by the function is discarded.
Syntax
CALL
sub_name
[(
a_param
[,
a_param
]...)]
Parameters
sub_name
Subprogram that control is transferred to.
a_param
Actual parameter - a value, a variable or an expression,
This parameter has a value of the appropriate type to be
assigned to the corresponding formal parameter in the
SUB statement that begins the subprogram or multi-line
function
sub_name
.
The CALL statement assigns the values of the actual
parameters to the corresponding formal parameters and
transfers control to the subprogram.
Execution of a SUBEXIT or SUBEND statement in the subprogram returns
control to the statement following the CALL statement provided there are
no pending softkey interrupt requests.
Example
10 READ A,B$
15 DATA 1,"Sample"
20 CALL Subrtn(A,B$) !Control goes to line 100