"Prof A Olowofoyeku (The African Chief)" wrote:
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.
Nor I. I vaguely recall that it is forbidden in at least ISO 7185, but cannot quote chapter and verse. This is a milestone, where BP is more standards adherent :=)