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 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
Download from the command line
curl -L -o sample.pas https://files.samplefiles.com/code/pas/sample.paswget https://files.samplefiles.com/code/pas/sample.pashttps://files.samplefiles.com/code/pas/sample.pasprintf '%s %s\n' 22c9d6faff2c3151b495a557e62c37218b25f52fe288ad6f7e7f764ed188a2bf sample.pas | shasum -a 256 -cOr check the download in your browser with the checksum calculator.