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

5-35
Parameters
n
The number to be converted. This can be of any numeric
type.
Examples
10 A = SINTEGER(5.678) !A = 6
SIZE
The SIZE function returns the number of records in a file, including
unused or empty records. The result is of type INTEGER.
Syntax
SIZE(
fnum
)
Parameters
fnum
The file number that HP Business BASIC/XL uses to
identify the file. It is a numeric expression that
evaluates to a positive short integer. An optional #
can precede
fnum
.
Examples
160 Filesize = SIZE(1) !Filesize is the number of records in file 1
SLEN
The SLEN function returns the string length of the next datum in a file.
If that item is not a string, SLEN returns -1. The result is of type
INTEGER.
Syntax
SLEN(
fnum
)
Parameters
fnum
The file number that HP Business BASIC/XL uses to
identify the file. It is a numeric expression that
evaluates to a positive short integer.
Fnum
must
specify a BASIC DATA file. An optional # can precede
fnum
.
Examples
100 CREATE "File1",FILESIZE=1000 !BDATA file; series of data items.
110 ASSIGN "File1" TO #1
120 POSITION #1; BEGIN !Rewind File1 before writing it.
130 PRINT #1; "abc", 123 !"abc" is item 1, 123 is item 2.
140 POSITION #1; BEGIN !Rewind File1.
150 DISP SLEN(1) !Next item, "abc", is a string;
155 ! return its length, 3.
160 READ #1; A$ !Read item 1.
170 DISP SLEN(1) !Next item, 123, is not a string;
175 ! return -1.
999 END
SQR
The SQR function returns the positive square root of a number. The
result is of type REAL.