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

FREADBYKEY

MPE documents

Complete PDF
Table of Contents
Index

Edition 7 E0701 ♥
Edition 7 E0300
Edition 6 E0195

NM and CM callable.

Reads a logical record randomly from a KSAM file to the data stack.


NOTE: For KSAM files only.

Syntax



  I16V                  I16V     LA      I16V    CA
  length := FREADBYKEY (filenum, target, tcount, keyvalue,
                        I16V
                        keylocation);

Functional Return


length

16-bit signed integer by value (assigned functional return)

Returns the length of the information transferred. If tcount is positive, length is a word count; if negative it is a byte count.

Parameters


filenum

16-bit signed integer by value (required)

Passes the file number of the file to be read.

target

logical array (required)

Contains the transferred record. It must be large enough to hold all the information to be read.

tcount

16-bit signed integer by value (required)

Passes the number of words or bytes to be transferred. If tcount is positive, it is the length in words; if negative, it is the length in bytes.

If tcount is less than the size of the record to be transferred, only the first tcount words or bytes are transferred from the record. If the tcount is larger than the physical record size, only the physical record length is transferred.

keyvalue

character array (required)

Passes the value determining the record to be read. The first record found with an identical value in the key specified by keylocation is the record read.

keylocation

16-bit signed integer by value (required)

Passes the relative byte location in the record of the key whose value determines which record is to be read. The first byte is numbered as 1. If a value of zero is specified, the primary key is used.

Condition Codes


CCE (2)Request granted.
CCG (0)Request denied. The logical end-of-data or beginning-of-data was encountered during the read.
CCL (1)Request denied. An error occurred. Either an I/O error occurred or the key could not be located.

Related Information


Intrinsics FREAD, FREADBACKWARD, FREADC, FREADDIR, FREADLABEL, FREADSEEK, FFINDBYKEY, FINDN, FREMOVE
Manuals Using KSAM XL
KSAM/3000 Reference Manual




FREADBACKWARD


FREADC