home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 February
/
Chip_2000-02_cd.bin
/
zkuste
/
Delphi
/
navody
/
tt
/
objvm.exe
/
UNITS
/
ValStack.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-03-13
|
1KB
|
59 lines
unit ValStack;
interface
uses LangValue,
LangValueList,LangValMessages;
type TValStack=class(IValStack)
protected
function rdFrameValues(No:integer):ILangValue;override;
public
Items:TLangValueList;
function Pop:ILangValue;override;
procedure Push(a:ILangValue);override;
procedure DropFrame;override;
function FrameCount:integer;override;
constructor Create;
destructor Destroy;override;
end;
implementation
function TValStack.rdFrameValues;
begin
if No>FrameCount-1 then
begin
end;
Result:=Items[Items.Count-FrameCount-1+No];
end;
function TValStack.Pop;
begin
Result:=Items[Items.Count-1];
Items.Remove(Items.Count-1);
end;
procedure TValStack.Push;
begin
Items.Add(a);
end;
procedure TValStack.DropFrame;
Var i:Integer;
begin
for i:=0 to FrameCount do
begin
Pop.Free;
end;
end;
function TValStack.FrameCount;
begin
Result:=Items[Items.Count-1].AsInteger;
end;
constructor TValStack.Create;
begin
Items:=TLangValueList.Create;
end;
destructor TValStack.Destroy;
begin
Items.Free;
Inherited Destroy;
end;
end.