Sign in Join
Wiki copytemporary

Get

The procedure get retrieves a datum from a file of … and advances the reading cursor. Although get is a standardized Pascal routine, in the FPC get is only available in an ISO-compliant mode, such as {$mode ISO}.

behavior

requirements

Before get is executed, two requirements must be met:

  1. The file must be in inspection mode.
  2. The file’s “cursor” may not be past EOF.

A run-time error occurs if either condition is not satisfied.

effect

Get

  1. advances the cursor by one record
  2. makes the new current record accessible via the file’s buffer variable.

To put this into relation:

application

Get is especially used to

begin

   while not EOF(input) do
   begin
       output^ := input^;
       get(input);
       put(output);
   end;

end.

see also


From the Free Pascal wiki, page "Get", as it stood on 2021-07-20 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 2, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.