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

5- 26
S2
$ A string expression indicating the substring. The
function returns the position of the first character of
S2
$.
Examples
10 A = POS("abcde","fg") !A = 0
20 B = POS("abcde","cd") !B = 3
REAL
The REAL function converts a number to a real number. The result is of
type REAL.
Syntax
REAL(
n
)
Parameters
n
The number to be converted. This can be of any numeric
type.
Examples
10 A = REAL(2) !A = 2.0000
REC
The REC function returns the number of the record indicated by a file's
record pointer.
Syntax
REC(
fnum
)
Parameters
fnum
The file number by which HP Business BASIC/XL identifies
the file. It is a numeric expression that evaluates to
a positive short integer. An optional # can precede
fnum
.
Examples
10 CREATE "File1",RECSIZE=5,FILESIZE=10 !BDATA file; 10 5-word records
11 ASSIGN "File1" TO #1
12 POSITION #1;BEGIN !Pointer at record 1.
13 DISP REC(#1) !Display 1.
14 POSITION #1;3 !Pointer at record 3.
15 DISP REC(#1) !Display 3.
16 PRINT #1,7; 502 !Print 502 on record 7
18 DISP REC(#1) !Display 7.
19 POSITION #1;END !Pointer at end of file.
20 DISP REC(#1)
99 END
RECSIZE
The RECSIZE function returns the number of bytes per record in a file.
The result of this function is of type INTEGER.
Syntax
RECSIZE(
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
100 Rec=RECSIZE(2) !Rec is number of bytes per record of file 2