Change your record into a class derived from TObject.
The string list objects are designed to hold TObjects (which are pointers).
It looks like the complier can put a record with one integer field into the
space for a pointer which is why the first one worked.
Wes
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of [EMAIL PROTECTED]
> Sent: Friday, 15 December 2000 05:17
> To: Multiple recipients of list delphi
> Subject: [DUG]: AddObject and record structures
>
>
> Hi all.
>
> I have been doing some stuff with ADDObject in stringlists and
> passing ecord structures thru.
>
> I found that I cold go...mystrings.addobject('hello',myrecord)
> perfectrly fine IF the record structrue only had one entry...
> i.e. TMyRecord = record
> iPs :Integer;
>
> BUT If I add an oher entry (1 or more of them)
> i.e. TMyRecord = record
> iPs :Integer;
> ime :integer;
> etc.
>
> It will no longer compile with an incompatable type error on the
> addobject line.
>
> Whay IS this....I am not sure whay this happens...can anyone
> offer an explination...and a solution?
>
> Cheer, Jeremy Coulter
>
>
>
>
>
>
> ------------------------------------------------------------------
> ---------
> 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"