HPlogo Using KSAM XL and KSAM 64 > Chapter 9 KSAM Intrinsics

FUPDATE

MPE documents

Complete PDF
Table of Contents
Index

E0300 Edition 4 ♥
E0394 Edition 3

Syntax Parameters Operation Notes Condition Codes

Updates the contents of a logical record in a file.

Syntax



           I16V     UDS     I16V
  FUPDATE (filenum, buffer, length);

Parameters


filenum

16-bit signed integer by value (required)

Passes the file number of the file to be updated.

buffer

user-defined structure (required)

Passes the record to be written in the update.

length

16-bit signed integer by value (required)

Passes the number of halfwords or bytes to be written to the file. A positive value is in halfwords; a negative value is in bytes.

If length is less than record size, the length is transferred in halfwords or bytes and remaining portions of the record will be padded with fill characters. If length equals zero, no transfer occurs and the record address is overwritten with default fill characters (blanks for ASCII files; null characters for binary files). If length is greater than record size, CCL is returned and no transfer occurs.

Operation Notes


This intrinsic does not read the advance flag. If the record's key data is unchanged, it does not position any pointers, but sets the advance flag to TRUE. If the record's key data changes, it positions the logical record pointer and the physical pointer to the appropriate record and sets the advance flag to FALSE. The act of updating the keys advances the pointers to the next record.

The record to be updated is the record pointed to by the logical data pointer. FUPDATE moves the specified information from the stack into this record. The file containing this record must be opened with the update aoption specified in the FOPEN/HPFOPEN call and the file cannot have variable-length records. If RIO access is used, the modified record is set to the ACTIVE state.

Condition Codes


CCE

Request granted.

CCG

Request denied. An end-of-file condition was encountered during updating.

CCL

Request denied. An error occurred. The length exceeds the size of the record, length does not include all the keys, or a disk I/O error occurred.

Refer to this intrinsic in the MPE/iX Intrinsics Reference Manual for other codes pertaining to KSAM files.




FUNLOCK


FWRITE