Guardian Procedure Calls Reference Manual

WRITEUPDATE[X] Procedures
Summary
Syntax for C Programmers
Syntax for TAL Programmers
Parameters
Condition Code Settings
Considerations
Disk File Considerations
Magnetic Tape Considerations
Considerations for WRITEUPDATEX Only
Errors for WRITEUPDATEX Only
Example
Related Programming Manuals
Summary
The WRITEUPDATE[X] procedures transfer data from an array in the application program to a file.
The WRITEUPDATE procedure is intended for use with 16-bit addresses, while the WRITEUPDATEX
procedure is intended for use with 32-bit extended addresses. The data buffer for WRITEUPDATEX
can be either in the caller's stack segment or any extended data segment.
For disk files, WRITEUPDATE[X] has two functions:
To alter the contents of the record at the current position
To delete the record at the current position in a key-sequenced or relative file
WRITEUPDATE[X] is used for processing data at random. Data from the application process' array
is written in the position indicated by the setting of the current-record pointer. A call to this procedure
typically follows a corresponding call to the READ[X] or READUPDATE[X] procedure. The
current-record and next-record pointers are not affected by the WRITEUPDATE[X] procedure.
For magnetic tapes, WRITEUPDATE[X] is used to replace a record in an already written tape. The
tape is backspaced one record; the data from the application process' array is written in that area.
NOTE: The WRITEUPDATE[X] procedures perform the same operation as the
FILE_WRITEUPDATE64_ Procedure (page 536), which is recommended for new code.
Key differences in FILE_WRITEUPDATE64_ are:
The pointer and tag parameters are 64 bits wide.
The write-count parameter is 32 bits wide.
The procedure returns an error code value rather than a condition code, simplifying
error-handling code.
WRITEUPDATE[X] Procedures 1509