HPlogo Accessing Files Programmer's Guide > Chapter 8 Writing to a File

Writing User Data in ANSI Labels

MPE documents

Complete PDF
Table of Contents
Index

E0300 Edition 6 ♥
E0692 Edition 5

It is possible to write data into bytes 5/21 of the HDR1 record of an ANSI tape label. In all, 17 bytes are available. If you write more than 8 bytes into the record, the 9th byte (Byte 13) must be a period (".").

For example, to write the string "FRANKSTN COUNCIL" into bytes 5/21, mount your tape and then do this:

  FILE FRANKSTN.COUNCIL;DEV=TAPE;REC=-80,,F,ASCII;LABEL=BUDGET,ANS
  FCOPY FROM=datafile;TO=*FRANKSTN.COUNCIL

where datafile is the name of a disk file. This coerces the string "FRANKSTN.COUNCIL" into bytes 5/21 of the HDR1 record, and it places "BUDGET" into the VOL1 record of the tape.

The "file" and "group" names are right-justified.

5678 9101112 13141516 17181920 21
FRAN KSTN .CO UNCI L

In order to retrieve the string recorded in bytes 5/21, you must create a program that uses the intrinsics FOPEN (or HPFOPEN) and FFILEINFO. The program must do two things:
  • It must FOPEN (or HPFOPEN) the tape device.

  • It must employ FFILEINFO with option 45 to retrieve the "file" identifier.

The tape containing such a label must be mounted before you run the program.




Writing a File Label to a Labeled Tape File


Chapter 9 Reading from a File