
Zitat von
PomBär:
Delphi-Quellcode:
var i,a:integer;
begin
i:=1; a:=0;
while i<10 do
a:=a+i;
i:=i+1;
end;
begin
label1.caption:=''(i);
er sagt mir, dass der auf a zugewiesene wert niemals benutzt wird.

Guck dir doch mal an, was er anzeigen soll und steht da irgendwo a
So wie dein Code aussieht, dürfte es eigentlich auch gar nicht gehn.
So dürfte es richtig sein:
Delphi-Quellcode:
var i,a:integer;
begin
i:=1; a:=0;
while i<10 do begin
a:=a+i;
i:=i+1;
end;
label1.caption:=InttoStr(a);
end;