<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>Thanks Martin.<br></div>
<div>Graeme I tested your way but you cant get property values with this way,if you test code that I sent before showmessage will show nothing.<br></div>
<div>but writeln will work.<br></div>
<blockquote><div> </div>
<div> { IFile }<br></div>
<div> </div>
<div> IFile = interface<br></div>
<div> function GetName: string;<br></div>
<div> procedure SetName(AValue: string);<br></div>
<div> property Name: string read GetName write SetName;<br></div>
<div> end;<br></div>
<div> </div>
<div> TFileList=specialize TFPGList<IFile>;<br></div>
<div> </div>
<div> </div>
<div> { TVideoFile }<br></div>
<div> </div>
<div> TVideoFile = class(TInterfacedPersistent, IFile)<br></div>
<div> private<br></div>
<div> FName: string;<br></div>
<div> FWidth: integer;<br></div>
<div> function GetName: string;<br></div>
<div> procedure SetName(AValue: string);<br></div>
<div> public<br></div>
<div> property Name: string read GetName write SetName;<br></div>
<div> property Width: integer read FWidth write FWidth;<br></div>
<div> end;<br></div>
<div> { TAudioFile }<br></div>
<div> </div>
<div> TAudioFile = class(TInterfacedPersistent, IFile)<br></div>
<div> private<br></div>
<div> FName: string;<br></div>
<div> FArtist: string;<br></div>
<div> function GetName: string;<br></div>
<div> procedure SetName(AValue: string);<br></div>
<div> public<br></div>
<div> property Name: string read GetName write SetName;<br></div>
<div> property Artist: string read FArtist write FArtist;<br></div>
<div> end;<br></div>
<div> </div>
<div>var<br></div>
<div> Form1: TForm1;<br></div>
<div> </div>
<div>implementation<br></div>
<div> </div>
<div>{$R *.lfm}<br></div>
<div> </div>
<div>{ TAudioFile }<br></div>
<div> </div>
<div>function TAudioFile.GetName: string;<br></div>
<div>begin<br></div>
<div> Result:=FName;<br></div>
<div>end;<br></div>
<div> </div>
<div>procedure TAudioFile.SetName(AValue: string);<br></div>
<div>begin<br></div>
<div> FName:=AValue;<br></div>
<div>end;<br></div>
<div> </div>
<div>{ TVideoFile }<br></div>
<div> </div>
<div>function TVideoFile.GetName: string;<br></div>
<div>begin<br></div>
<div> Result:=FName;<br></div>
<div>end;<br></div>
<div> </div>
<div>procedure TVideoFile.SetName(AValue: string);<br></div>
<div>begin<br></div>
<div> FName:=AValue;<br></div>
<div>end; <br></div>
</blockquote><div> </div>
<blockquote><div>var<br></div>
<div>V1,V2:TVideoFile;<br></div>
<div>A1,A2:TAudioFile;<br></div>
<div>Fl:TFileList;<br></div>
<div>begin<br></div>
<div>Fl:=TFileList.Create;<br></div>
<div>V1:=TVideoFile.Create;<br></div>
<div>V1.Name:='V';<br></div>
<div>V1.Width:=100;<br></div>
<div>A1:=TAudioFile.Create;<br></div>
<div>A1.Name:='A';<br></div>
<div>A1.Artist:='Art';<br></div>
<div>FL.Add(V1);<br></div>
<div>FL.Add(A1);<br></div>
<div>V2:=TVideoFile(FL.Items[0]);<br></div>
<div>A2:=TAudioFile(Fl.Items[1]);<br></div>
<div>ShowMessage(V2.Name);<br></div>
<div>ShowMessage(A2.Name);<br></div>
<div>end;<br></div>
<div> </div>
</blockquote><div> </div>
<div>Regards,<br></div>
<div>Ara<br></div>
<div> </div>
<div> </div>
<pre>
--
http://www.fastmail.com - Access all of your messages and folders
wherever you are
</pre>
</body>
</html>