Thanks James, Ben & Reg. It's looks rather messy to me. I didn't realise you
can create numerous duplicate objects with the same name. Is there any
advantage to using a Record object as opposed to a class(TObject)?
Ross.
James Low wrote:
> Thanks Ben ...
>
> -----Original Message-----
> From: Ben Taylor [mailto:[EMAIL PROTECTED]]
> Sent: 6 July 2001 17:01
> To: Multiple recipients of list delphi
> Subject: RE: Listbox items (Was: Re: [DUG]: array of TStringList)
>
> > AddObject('Somestring to display', myObject);
> > myObject.Free; //the list owns a reference to it now
>
> you _really_ dont want to do this.. the list now has a pointer to the
> object, but its still the same object. if you do the free, then the
> list holds an invalid pointer.
>
> > myObject := Listbox1.Objects[ListBox1.Listindex];
> this wont compile. you'll need to cast the TObject pointer to the
> correct type:
>
> myObject := tRossesObject(Listbox1.Objects[ListBox1.Listindex]);
>
> that should work better..
>
> there are 'nicer' OO ways to do this but it's friday and i'm going now
> :-)
>
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
> ---------------------------------------------------------------------------
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> ---------------------------------------------------------------------------
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"