Code · 1 file

Sample Pascal File

Free Pascal in objfpc mode, with records, functions and formatted output. Every language sample implements the same small program so you can compare them side by side.

Pascal · 1 KB

Sample Pascal file

An idiomatic Pascal example — the same customer program (or, for hardware languages, a small counter design) we offer in every language.

CC0 · free for any use · Verified by an independent tool · Report a problem

sample.pas — first linesPascal
{ Sample Free Pascal program — samplefiles.com }
program Sample;

{$mode objfpc}{$H+}

type
  TCustomer = record
    Id: Integer;
    Name: string;
    Balance: Double;
  end;

function MakeCustomer(Id: Integer; const Name: string; Balance: Double): TCustomer;
begin
  Result.Id := Id;
  Result.Name := Name;
  Result.Balance := Balance;
end;

function IsVip(const C: TCustomer): Boolean;
begin
  Result := C.Balance >= 10000;
end;

function PadRight(const S: string; Width: Integer): string;

File details

Size
1 KB (1,117 bytes)
MIME type
text/x-pascal
SHA-256
22c9d6faff2c3151b495a557e62c37218b25f52fe288ad6f7e7f764ed188a2bf
MD5
6f748aeb35b13a4eb1ff8971a47a08b4

Download from the command line

curl -L -o sample.pas https://files.samplefiles.com/code/pas/sample.pas

Or check the download in your browser with the checksum calculator.