> Oh boy, I have a real problem, the following code produces an access
> violation on the laptop I am using to develop.
> I have D3 and D5 on the same machine, the code works fine with D3 but
> produces the AVI when compiled with D5. The compiled code produces the AVI
> when run on other machines as well.
AVI is a Graphhic animation format. AV stands for Access violation....
> I had the D5 upgrade, since removed D5 and re-installed but still have the
> problem. I suspect I must have a corrupt windows file or something, can
> anyone help
> procedure TForm1.Button1Click(Sender: TObject);
> var
> tl : tlist;
> begin
> tl.Create;
> tl.Clear;
> end;
No it's simply your code... Think of 'tl' as a big pointy finger that points at yout
TList
object. You have to tell 'tl' where to point with a := as in
procedure TForm1.Button1Click(Sender: TObject);
var
tl : tlist;
begin
tl := TList.Create;
try
// No need to tl.Clear because it's always empty when created.
finally
tl.Free;
end;
// The Try...Finally...Free...End... is there to fullfill your responsibility of
freeing
// objects that you create so that memory is returned to the system when you're
// finished with the object.
end;
--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz