Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-05

for cycle variable

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Rimgaudas Laucius

Hi,

i found that in fpc 1.9.6 assignment to "for cycle" variable is forbidden. Such behavior is incompatible with other compilers. Earlier fpc versions also had only warning. What do you think about this?

var
  i: integer;
begin
  for i:= 1 to 2 do
    inc(i);
end.

Reply by email

Florian Klaempfl
to Rimgaudas Laucius
Rimgaudas Laucius wrote 6 lines
Hi, i found that in fpc 1.9.6 assignment to "for cycle" variable is forbidden. Such behavior is incompatible with other compilers.

As ...?

Earlier fpc versions also had only warning. What do you think about this?

Well, what we think should be clear ;)

Show quoted text 8 lines
var i: integer; begin for i:= 1 to 2 do inc(i); end.

Reply by email