Weil dein Quellcode mehrere Fehler enthält:
Delphi-Quellcode:
unit Keller;
interface
type
TKeller =
class
constructor create;
procedure push(m:
string);
procedure pop;
function top:
string;
Keller:
array of char;
end;
var
n: integer;
oKeller: TKeller;
implementation
constructor TKeller.create;
begin
inherited create;
n:=1;
end;
procedure TKeller.push(m:
string);
begin
inc(n);
setlength(Keller,n);
Keller[n-1] := m;
end;
procedure TKeller.pop;
begin
dec(n);
setlength(Keller,n);
end;
function TKeller.Top:
string;
begin
result := Keller[n-1];
end;
end.