Getting Started on Programming the HP 4155A/4156A
Programming for Data Extraction
BDAT Second parameter species
total
number of records to
allocate for the le, so you must specify a sucient
number of records.You can specify a record length by
using an optional third parameter (default length is 256
bytes).
For example, the following statement creates a le with 7
records (each record is 128 bytes):
CREATE BDAT "B_file",7,128
The following statement creates a le with 7 records
(each record is 256 bytes):
CREATE BDAT "B_file",7
2. Open an I/O path for transferring data into the le
.
To open an I/O path to the le, assign an I/O path name to the le by using
an ASSIGN statement as in the following example:
340 INPUT "Enter file name to store data",File$
350 CREATE File$,1
360 ASSIGN @File TO File$;FORMAT ON
Line 350 creates a DOS le, then line 360 opens an I/O path to the le
.
For DOS and BDAT les, ASSIGN statement can also specify the following:
FORMATON ASCII data representations are used. Specify
this if you need to transport data between
IBASIC and other machines.
FORMAT OFF IBASIC internal data representations are used.
Specify this if you need a faster transfer rate
and space eciency.
3. Store data into the le.
To store data into a le, use
OUTPUT
and
ENTER
statements as in the
following examples:
340 INPUT "Enter file name to store data",File$
350 CREATE File$,1
360 ASSIGN @File TO File$;FORMAT ON
.
.
.
390 REPEAT
.
.
.
440 OUTPUT @Hp415x;":DATA? 'VTH'"
450 ENTER @Hp415x;Vth
3-19