On Mon, 6 Mar 2006 06:18:28 +0100
"Christian U." <[EMAIL PROTECTED]> wrote:

> > type
> >  TListenStruktur = class (TObject)
> >    private
> >      hListe: TList;
> >      AktuellePosition: Integer;
> > ...
> >
> > and a function
> >
> > function TListenStruktur.GetElement: TObject;
> > begin
> >  if not IsEmpty then
> >    GetElement := hListe.Items[AktuellePosition]
> > end;
> 
> hListe.Items^[AktuellePosition]
> 
> ist richtiger, Delphi findet selbst heraus ob n Zeiger oder Objekt benö
> tigt  wird.
> FPC ist da etwas genauer :) 

Maybe you are confusing this with pointer to records? (^. vs .)
hList is a TList, so Items is an indexed property. The ^ will not work.
The fix is already mentioned: a typecast to TObject.


Mattias


_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to