DO
-- Read a parameter list, terminated by a
CR:
ENABLE
IO.Error =>
IF ec = SyntaxError
THEN {
IO.Reset [in];
out.PutF ["\nIncorrect input. Please retype.\n\n"];
LOOP}
ELSE EXIT;
IO.PutF [stream: out,
format: "%lLower left and upper right coord. of rect. (terminate with CR): %l",
v1: IO.rope["e"], v2: IO.rope["E"]];
r.x1 ← IO.GetInt [in]; r.y1 ← IO.GetInt [in];
r.x2 ← IO.GetInt [in]; r.y2 ← IO.GetInt [in];
counter ← SUCC [counter];
nr ← NEW [INT]; nr^ ← counter;
CStitching.ChangeRect [plane, r, nr];
IO.PutF1 [out, " Rectangle %g inserted.\n", IO.int[nr^]];
t ← CStitching.FindTile [plane, [r.x2-r.x1, r.y2-r.y1]];
value ← NARROW [t.value, REF INT];
s ← CStitching.Area [t];
IO.PutF [stream: out,
format: "\nRectangle %g found in plane: %g, %g; %g, %g.\n\n",
v1: IF value = NIL THEN IO.rope ["NIL"] ELSE IO.int [value^],
v2: IO.int [s.x1],
v3: IO.int [s.y1],
v4: IO.int [s.x2],
v5: IO.int [s.y2]];
ENDLOOP;