On 29 Jun 2005 at 8:19, Frank Heckenbach wrote:
GPC accepts the following program, but produces quite silly results:
program Foo;
var a: array [1 .. 2] of Integer value (0, 0); i: Integer;
begin i := 1; for a[i] := 1 to 10 do begin WriteLn (i, ' ', a[i]); if a[i] = 5 then i := 2 end end.
The problem is that it evaluates the index i each time, not once before the loop. It would be possible to fix it, but do we really want that? Neither BP nor CP/EP allow it, they allow only identifiers in for-loops.
Waldek and I see no need for such a feature.
Neither do I.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/