HP Pascal/iX Reference Manual (31502-90022)

6: 15
Example
PROGRAM show_with;
TYPE
status = (married, widowed, divorced, single);
date = RECORD
month : (jan, feb, mar, apr, may, jun,
july, aug, sept, oct, nov, dec);
day : 1..31;
year : integer;
END;
person = RECORD
name : RECORD
first, last: string[10]
END;
ss : integer;
sex : (male, female);
birth : date;
ms : status;
salary : real
END;
VAR
employee : person;
BEGIN {show_with}
.
WITH employee, name, birth DO
BEGIN
last := 'Hacker';
first := 'Harry';
ss := 214748364;
sex := male;
month := feb;
day := 29;
year := 1952;
ms := single;
salary := 32767.00
END;
.
END. {show_with}
GOTO
A GOTO statement transfers control unconditionally to a statement marked
by a label. It consists of the reserved word GOTO and the specified
label.
The scope of labels is restricted. They may only mark statements
appearing in the executable portion of the block where they are declared.
They cannot mark statements in inner blocks. GOTO statements, however,
may appear in inner blocks and reference labels in an outer block.
Therefore, it is possible to jump out of a procedure or function, but not
into one.
A GOTO statement may not lead into a structured statement from outside
that statement or from another component statement of that statement.
For example, it is illegal to branch to the ELSE part of an IF statement
from either the THEN part, or from outside the IF statement. Note that a
GOTO statement that refers to a non-local label declared in an outer
routine, causes any local files to be closed.
Labels are numeric values in the range 0 through 9999.