Accessing Files Programmer's Guide (32650-90885)
226 AppendixA
Pascal/XL Program Examples
Program Example A-5
subsys : shortint);
1 : (all : integer);
end;
var
disk_file : integer;
filename : pac80;
std_list : integer;
std_in : integer;
outbuf : pac80;
function FREAD: shortint; intrinsic; { sequential reads }
procedure HPFOPEN; intrinsic; { open files }
procedure FCLOSE; intrinsic; { close files }
procedure FWRITE; intrinsic; { sequential writes }
procedure FWRITEDIR; intrinsic; { random access writes }
procedure FUNLOCK; intrinsic; { unlock locked file }
procedure PRINTFILEINFO; intrinsic; { use in error handler }
procedure FLOCK; intrinsic; { lock file }
procedure FUPDATE; intrinsic; { update record }
procedure QUIT; intrinsic; { use in error handler }
procedure handle_file_error
(
file_num : shortint;
quit_num : shortint
);
{************************************************************************}
{ procedure handle_file_errorPrints the file information on the
}
{ session/job list device. }
{************************************************************************}
begin
PRINTFILEINFO (file_num);
QUIT (quit_num);
end; { end handle_file_error }
procedure open_file
(
var file_num : integer;
file_name : pac80;
domain : integer;
access : integer;
excl : integer
lockable : integer;
);
{************************************************************************}
{ procedure open_file is a generic file opening procedure that allows
you}
{ to specify the designator, domain, access type, ASCII/binary, and