Contents | Prev | Next

7.4.40 The put procedure

Description

The put procedure writes the contents of a file's buffer variable to the file and empties the file's buffer variable leaving it undefined (see file type for more information about buffer variables). NOTE: This procedure is seldom used since it is usually easier to use the write or writeln procedures.

Parameter

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

Example

The simple program below uses the built-in procedure put to write a message to the standard output.

   program hello2(output);
   begin
      output^ := 'H';
      put(output);
      output^ := 'e';
      put(output);
      output^ := 'l';
      put(output);
      output^ := 'l';
      put(output);
      output^ := 'o';
      put(output);
      output^ := ' ';
      put(output);
      output^ := 'w';
      put(output);
      output^ := 'o';
      put(output);
      output^ := 'r';
      put(output);
      output^ := 'l';
      put(output);
      output^ := 'd';
      put(output);
      output^ := '!';
      put(output);
      output^ := '!';
      put(output);
   end.

Portability

Operating Systems: All
Standard Pascal: No

Contents | Prev | Next