HPlogo Using NS 3000/iX Network Services: HP 3000 MPE/iX Computer Systems > Chapter 3 Remote File Access

Example RFA Program

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

What follows is a Pascal program that writes some test data to a remote file, reads the data back from the remote file, and sends the received data to a remote printer to be printed. An environment has been established on the remote node. Prior FILE commands have been issued for the formal file designators representing the remote disk file and remote printer. These file equations specify the remote location of the files.

$standard_level 'hp3000'$$uslinit${**********************************}{Note: issue file equations such as}{     :file remfile=remfile:rodan}{     and}(     :file remprint;dev=rodan#lp}{before running this program}{**********************************}program rfaprog(remfile,remprint,output);type          teststring   =   packed array [1..72] of char;          smallint     =   -32768..32767;var          remfile      :   text;          remprint     :   text;          i            :   integer;          test1        :   teststring;          test2        :   teststring;begin {program rfaprog}{open remote disc file}writeln('Opening remote disc file');rewrite (remfile);{write test data to remote file}test1: = 'Remote File Access test';for i: = 1 to 9 dowriteln (remfile,test1);{open remote line printer as devicefile}writeln('Opening remote LP file');reset (remfile);{read each record from remote file, then print each record on remote printer}rewrite (remprint);for i := 1 to 9 
          begin          readln (remfile,test2);          writeln (remprint,test2);{pick up listing on remote line printer and check output}          end;end {program rfaprog}.  {remote files/devices closed automatically}
Feedback to webmaster