HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4- 154
Syntax
UNLOCK
#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.
Examples
100 CREATE "File1",FILESIZE=1200
200 ASSIGN "File1" TO #10 !Assigns file to #10.
300 LOCK #10 !File is locked.
400 PRINT #10; A,B,C
500 UNLOCK #10 !File is unlocked after printing.
999 END
For more information, see the LOCK statement.
UNPACK
The UNPACK statement assigns the values of individual data items
contained in one scalar string variable to one or more HP Business
BASIC/XL variables. The correspondence of the values in the scalar
string variable is determined by the order of the variables listed in the
referenced PACKFMT statement.
Syntax
UNPACK USING
line_id
;
str_var
Parameters
line_id
Specifies the program line of the appropriate PACKFMT
statement that specifies the variables to be unpacked
and the current format in which they are packed within
str_var
.
str_var
Scalar string variable from which variables are to be
unpacked.
Examples
The following example shows the use of the UNPACK statement. Lines 120
and 130 contain the PACKFMT statements that the UNPACK statements use.
Lines 210 and 220 PACK the data using those PACKFMT statements, and lines
235 and 236 UNPACK the data, and assigns them to the referenced
variables.
100 INTEGER Number, Times(4)
105 INTEGER Num, N1(4)
110 DIM String$[10], S1$[10], S2$[10]
115 DIM A$[10], P1$[60], P2$[60]
120 Pack1: PACKFMT Number,String$,A$,Times(*)
130 Pack2: PACKFMT Times,SKIP 2,String$,SKIP 1,Number,SKIP 1,A$[3;5]
140 Number=1234
150 Times(1)=65
160 Times(2)=73
170 Times(3)=42
180 Times(4)=90
190 String$="abcd"
200 A$="efghi"
210 PACK USING Pack1; P1$
220 PACK USING Pack2; P2$
230 Pack3: PACKFMT Num,S1$,S2$,N1(*)
235 UNPACK USING Pack3;P1$