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. NOTE: This procedure is seldom used since it is usually easier to use the write or writeln procedures.
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.
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.
Operating Systems: All
Standard Pascal: No