HPlogo MPE/iX Intrinsics Reference Manual > Chapter 6 Command Definitions (FLUSHLOG-GETUSERMODE)

FREADLABEL

MPE documents

Complete PDF
Table of Contents
Index

Edition 7 E0701 ♥
Edition 7 E0300
Edition 6 E0195

NM and CM callable.

Reads a user-defined label from a disk or magnetic tape file.

Syntax



              I16V     UDS     I16V    I16V
  FREADLABEL (filenum, buffer, length, labelid);

Parameters


filenum

16-bit signed integer by value (required)

Passes the file number of the file whose label is to be read.

buffer

user-defined structure (required)

Returns the label that was read. This structure must be large enough to hold the number of half words specified by length.

length

16-bit signed integer by value (optional)

Passes the number of half words to be transferred from the label, <=128.

Default: 128 half words

labelid

16-bit signed integer by value (optional)

Passes the label number. For labeled tapes, labelid is ignored. The next sequential label is read.

Default: Zero

Operation Notes


When a disk file is opened, user labels can be read from, or written to, in any order, at any time, regardless of access capabilities to the rest of the file. A disk file can have <=254 128-half word user-defined labels.

A magnetic tape file (if labeled) must be labeled with an ANSI-standard or IBM-standard label. The operating system automatically skips over any unread user-defined labels when the first FREAD intrinsic call for files is issued. To read a user-defined label, you should call the FREADLABEL intrinsic immediately after an FOPEN/HPFOPEN intrinsic has opened the file. The user-defined label must be 40 half words in length to conform to the length of the ANSI-standard or IBM-standard label.

Condition Codes


CCE (2)Request granted. The label was read.
CCG (0)Request denied. A label was referenced beyond the label written on the file.
CCL (1)Request denied. The label was not read; an error occurred.

Related Information


Intrinsics FREAD, FREADBACKWARD, FREADBYKEY, FREADC, FREADDIR, FREADSEEK, FWRITELABEL
Manuals Accessing Files Programmer's Guide




FREADDIR


FREADSEEK