typestar

The program shape in Delphi

A lighthouse log greeting built from the smallest set of parts a Delphi program needs.

// Every Delphi program opens with a program header and ends with end.
program HelloProgram;
uses SysUtils;      // SysUtils supplies Format and other helpers

const
  Station = 'Pigeon Point';
  Keeper = 'A. Marrow';

begin
  // Statements sit between begin and end, separated by semicolons.
  WriteLn('lighthouse log opened');
  WriteLn(Format('station: %s', [Station]));
  WriteLn(Format('keeper on watch: %s', [Keeper]));
  // The closing end of a program takes a period, not a semicolon.
end.

How it works

  1. program HelloProgram; names the program and uses SysUtils; pulls in Format.
  2. The const block fixes Station and Keeper before the body starts.
  3. Three WriteLn calls run between begin and end., which closes with a period.

Keywords and builtins used here

The run, in numbers

Lines
15
Characters to type
483
Tokens
57
Three-star pace
80 tpm

At the three-star pace of 80 tokens a minute, this run takes about 43 seconds.

Type this snippet

Step 1 of 3 in Programs & variables, step 1 of 27 in Language basics.

Next →

The program shape in other languages