7. Embedded QUEL for Pascal : Pascal Variables and Data Types : Variable and Type Declarations : File Type Definition
 
Share this page                  
File Type Definition
The declaration for a file type definition has the following syntax:
type type_name = file of type_definition;
Syntax Notes:
1. A variable of type file can only be used with EQUEL through the file buffer. A file buffer for a given type_definition is referenced in the same manner as a pointer to the same type.
2. Components of a packed file cannot be passed to the EQUEL runtime routines. Therefore, you should not declare packed files to EQUEL.
The following example illustrates the use of a file type definition:
##  var
##      myfile : file of Integer;
##  begin
        ...

        get (myfile);
##      append to emp (floor = myfile^);
        ...

##      retrieve (myfile^ = emp.floor)
##      begin
                put (myfile);
##      end;