HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
5- 10
Syntax
CPOS
Examples
200 PRINT CPOS
CPU
If called from within either an interpreted or compiled program, the CPU
function returns the number of CPU seconds elapsed since the beginning of
program execution.
If typed directly in response to the interpreter prompt, the CPU function
returns the total number of CPU seconds required for the execution of the
last previous program to execute in the interpreter.
The result of this function is a REAL number.
Syntax
CPU
Examples
100 Cpu_time = CPU
110 PRINT "CPU time is: " ; CPU
>
The above example returns a REAL value that contains the elapsed CPU
time.
CSUM
The CSUM function returns an array that contains the sum of the elements
of each column of an array. Both arrays must be of the same type. The
result has the format
MAT
num_array1
= CSUM(
num_array2
)
where element
i
of
num_array1
is the sum of the elements in column
i
in
num_array2
.
num_array2
is dimensioned (
m
,
n
) and
num_array1
is
dimensioned (
n
). The data type of the resulting array is the same as
that of the argument.
The CSUM function is used in the MAT = statement, with two dimensional
arrays.
Syntax
CSUM(
array
)
Parameters
array
Structured collection of variables of the same type.
The structure is determined when the array is declared.
This array can be of any type.
Examples
10 DIM A(4)
20 DIM B(3,4)
.
.
.
80 MAT A = CSUM(B)
IF B is
8 5 7 3
0 2 9 1
4 6 0 5
then A is