Flow-control structures: Difference between revisions

Content added Content deleted
m (→‎{{header|Go}}: little technicalities)
m (→‎The basic: GO TO label: with details, however.)
Line 593: Line 593:
=={{header|Fortran}}==
=={{header|Fortran}}==
===The basic: GO TO ''label''===
===The basic: GO TO ''label''===
Fortran offers <code>GO TO ''label''</code> where ''label'' is a number, an integer, which is prefixed to some executable statement according to the rules of Fortran source layout. It is not considered to be a numerical value, though zero is not an allowed label. Fortran has no reserved words and gives no significance to spaces, so that <code>G O TO 12 3 4</code> is just as valid as <code>GO TO 1234</code> and other usages. As a result of this, text labels are difficult to fit into the syntax so that the likes of <code>GO TO START</code> are (normally) unavailable.
Fortran offers <code>GO TO ''label''</code> where ''label'' is a number, an integer, which is prefixed to some executable statement according to the rules of Fortran source layout. It is not considered to be a numerical value, though zero is not an allowed label and leading zero digits are ignored. Fortran has no reserved words and gives no significance to spaces, so that <code>G O TO 12 3 4</code> is just as valid as <code>GO TO 1234</code> and other usages. Text labels are not allowed, however a statement such as <code>GO TO START</code> is possible. Even so, "START" is not itself a label, but the name of a variable which is used in special ways - see the ASSIGN statement usage, below.


===Elaborations on GO TO===
===Elaborations on GO TO===