HP 3000 Manuals

Updating a File [ SPL to HP C/XL Migration Guide ] MPE/iX 5.0 Documentation


SPL to HP C/XL Migration Guide

Updating a File 

SPL uses the MPE V intrinsic FUPDATE to replace the record last accessed
in the file by any intrinsic.  This is commonly used to update part of a
record that has been located by some identifying data in the same record.
The records cannot be variable-length.

HP C/XL has no direct equivalent of the FUPDATE intrinsic.  You will have
to emulate it by using the HP C/XL function ftell to give you the record
start byte before you read it.  Then you can reposition the file with the
fseek function and rewrite the record with fputs, fwrite, or write.  You
can even write records with fprintf and the rest as long as you remember
to write a '\n' character, signaling end-of-record to HP C/XL .



MPE/iX 5.0 Documentation