Accessing Files Programmer's Guide (32650-90885)

Appendix A 227
Pascal/XL Program Examples
Program Example A-5
}
{ exclusive options for the file. }
{************************************************************************}
const
{**define HPFOPEN item numbers**}
formal_designator_option = 2;
domain_option = 3;
access_type_option = 11;
ascii_binary_option = 53;
exclusive_option = 13;
dynamic_locking_option = 12;
var
ascii : integer;
{define scratch variables }
msgbuf : pac80;
status : status_type;
begin
ascii := 1;
HPFOPEN (file_num, status, formal_designator_option, file_name,
domain_option, domain,
ascii_binary_option, ascii,
access_type_option, access,
exclusive_option, excl
dynamic_locking_option, lockable);
if status.all <> 0 then
handle_file_error (file_num, 1);
end; { end open_file }
procedure update_file
(
old_discfile : integer
);
{************************************************************************}
{ procedure update_file pdates records in the disk file with the }
{ replacement read from the stdin. }
*************************************************************************}
var
dummy : integer;
inbuf : array [1..80] of char;
end_of_file : boolean;
read_length : integer;
begin
{Lock the file and suspend }