The get procedure


The get procedure reads the next component from a file into the file's buffer variable. NOTE: This procedure is seldom used since it is usually easier to use the read or readln procedures.


The get procedure's only parameter is a reference to the file variable associated with the file to be read. The file variable must be open before calling this function.


   //This program is similar to the unix shell command "cat".
   //It uses the built-in procedures "get" and "put" as well
   // as the file buffer's associated with the input and
   // output file to copy the contents of the input file to
   // the output file.
   program cat(f, g);
      f, g : text;
      c : char;
      while not eof(f) do
            c := f^;
            g^ := c;


Operating Systems: All
Standard Pascal: Yes