FOCAL

From Computer History Wiki
Revision as of 12:22, 12 May 2023 by Jnc (talk | contribs) (Always 'type' floating point)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

FOCAL was an early interpreted programming language, very similar to BASIC, produced by DEC for use on smaller computers such as the PDP-8.

The syntax of FOCAL is very similar to that of BASIC; every statement has a line number. Statements can be entered in any order, but they will be executed in numerical order. One difference is that BASIC line numbers are integers, but FOCAL line numbers are in two parts (looking rather like floating point numbers). This allows groups of lines to be treated as an entity, e.g. for subroutines.

Conditional statements ('IF') include an expression, and three lines numbers. If the expression's value is less than zero, the first statement is executed; if zero, the second; or if greater than zero, the third. The second and third lines numbers are optional. Loops ('FOR') are also available.

Variable names are one or two characters long, of which the first must be a letter (other than 'F'). All variables always have a type of floating point. Arrays are available.

A library of trigonometric functions is standard.

External links