home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 February
/
Chip_2000-02_cd.bin
/
zkuste
/
Delphi
/
navody
/
tt
/
objvm.exe
/
UNITS
/
RootValue.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-03-13
|
2KB
|
63 lines
unit RootValue;
interface
uses LangValue,
LangValueList;
{LangValue for use as Root value of IExecution and }
{IObjVM }
type TRootValue=class(ILangValue)
protected
function rdValues(const s:string):ILangValue;override;
public
{List of Values included in Root}
ValueList:TLangValueList;
function HasValue(const s:string):boolean;override;
constructor Create;
destructor Destroy;override;
procedure Add(a:ILangValue);
function CreateEqu:ILangValue;override;
end;
implementation
uses ProxyValue;
function TRootValue.rdValues;
Var i:integer;
begin
for i:=0 to ValueList.Count-1 do
begin
if ValueList[i].HasValue(s) then
begin
Result:=ValueList[i].Values[s];
break;
end;
end;
end;
function TRootValue.HasValue;
Var i:Integer;
begin
Result:=false;
for i:=0 to ValueList.Count-1 do
begin
Result:=Result or ValueList[i].HasValue(s);
end;
end;
constructor TRootValue.Create;
begin
inherited Create(nil);
ValueList:=TLangValueList.Create;
end;
destructor TRootValue.Destroy;
begin
ValueList.Free;
inherited Destroy;
end;
procedure TRootValue.Add;
begin
ValueList.Add(a);
end;
function TRootValue.CreateEqu;
begin
Result:=TProxyValue.CreateFrom(Self);
end;
end.