Difference between revisions of "FOCAL"
(Very stubby, but a start) |
(Always 'type' floating point) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | '''FOCAL''' was an early [[interpreter|interpreted]] [[programming language]], similar to [[BASIC]], produced by [[Digital Equipment Corporation|DEC]] for use on smaller computers such as the [[PDP-8]]. | + | '''FOCAL''' was an early [[interpreter|interpreted]] [[programming language]], very similar to [[BASIC]], produced by [[Digital Equipment Corporation|DEC]] for use on smaller computers such as the [[PDP-8]]. |
− | {{stub}} | + | 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 [[execute]]d 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 [[subroutine]]s. |
+ | |||
+ | [[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. [[Loop]]s ('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. [[Array]]s are available. | ||
+ | |||
+ | A [[subroutine package|library]] of trigonometric [[function]]s is standard. | ||
+ | |||
+ | {{semi-stub}} | ||
==External links== | ==External links== |
Latest revision as of 12:22, 12 May 2023
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
- PDP-8 FOCAL - documentation at Bitsavers
- FOCAL Programming Manual (DEC-08-AJAB-D)
- A FOCAL Primer
- DPF FOCAL