home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 February
/
Chip_2000-02_cd.bin
/
zkuste
/
Delphi
/
navody
/
tt
/
objvm.exe
/
UNITS
/
NamedValuesList.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-03-13
|
2KB
|
63 lines
unit NamedValuesList;
interface
uses
LangValue,ObjStr;
type TNamedValuesList=class
protected
fItems:TObjectStrings;
function rdItems(No:integer):ILangValue;
function rdNames(No:Integer):string;
public
constructor Create;
destructor Destroy;override;
property Items[No:integer]:ILangValue read rdItems;default;
property Names[No:integer]:string read rdNames;
function Count:integer;
function ValByName(const a:string):ILangValue;
procedure Add(const Name:string;a:ILangValue);
procedure DeleteValue(a:ILangValue);
end;
implementation
function TNamedValuesList.rdItems;
begin
Result:=fItems.Objects[No] as ILangValue;
end;
function TNamedValuesList.rdNames;
begin
Result:=fItems[No];
end;
constructor TNamedValuesList.Create;
begin
Inherited Create;
fItems:=TObjectStrings.Create;
end;
destructor TNamedValuesList.Destroy;
begin
fItems.Free;
Inherited Destroy;
end;
function TNamedValuesList.Count;
begin
Result:=fItems.Count;
end;
function TNamedValuesList.ValByName;
Var i:Integer;
begin
i:=fItems.IndexOf(a);
if i=-1 then
Result:=nil
else
Result:=fItems.Objects[i] as ILangValue;
end;
procedure TNamedValuesList.Add;
begin
fItems.AddObject(Name,a);
end;
procedure TNamedValuesList.DeleteValue(a:ILangValue);
begin
fItems.Remove(fItems.IndexOfObject(a));
end;
end.