Accessing Files Programmer's Guide (32650-90885)

206 AppendixA
Pascal/XL Program Examples
procedure open_file
(
var file_num : integer;
file_name : pac80;
domain : integer;
access : integer
);
{************************************************************************}
{ procedure open_file acts as a generic file open procedure allowing }
{ you to specify the domain option and the access type option }
{************************************************************************}
const
{**define HPFOPEN item numbers**}
formal_designator_option = 2;
domain_option = 3;
access_type_option = 11;
ascii_binary_option = 53;
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);
if status.all <> 0 then
handle_file_error (file_num, 2);
end; {end procedure }
procedure copy_tapefile_to_discfile
(
tape_file : integer;
disk_file : integer
);
{************************************************************************}
{ procedure copy_tapefile_to_discfile copies logical records }
{ sequentially from tape file to disk file with concurrent print to }
{ stdlist. }
{************************************************************************}
var