items in the collection. To do this I am making another tempvariable of the
same kind of TCollection and then whenI am finished, I am doing oCollection
:= oTmpCollection
>It will accept it, BUT it causes an access violation whenever I try to
access any items with int oCollection.
>
>Can anyone tell me why or whatI am doing wrong ?



if your intent is to create a copy of oTmpCollection (i.e. copies of all the
contents)
and then assign that new object to be the value of oCollection do this
instead

      oCollection.Assign( oTmpCollection );


what you are doing leaves you with oCollection and oTmpCollection
referencing
the identical object.   A ticking time bomb - for example when
oTmpCollection.Destroy
gets called oCollection now references a non existent object

ns

---------------------------------------------------------------------------
    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"

Reply via email to