Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'd like TlistA := TListB

Status
Not open for further replies.

LucieLastic

Programmer
May 9, 2001
1,694
GB
hi all

I have 2 objects, each containing a TList variable.

ObjA contains the Tlist.create etc and populates the list (say ListA).
ObjB only has a TList variable, say ListB and doesn't do a create as I don't want 2 separate lists;

procedure ObjA.thing;
begin
ObjB.DoSomething(ListA)
end;

in ObjB
procedure ObjB.DoSomething(ListA : TList);
begin

ListB := ListA;

end;

I thought the above assignment would make ListB equal to the same pointer as ListA. I know I'm passing a TList but I also thought that really I'm passing a pointer to a TList. I'm confused.

All I want is ListB's pointer to equal ListA's pointer. The program doesn't fail but I get bits of garbage in the list. What do I need to do?

lou
 
Sorry, it seems to be the passing to the object where it messes up. The assignment seems to be okay.
 
Forget this thread. I had a double assigned to an integer in the record structure of the list. It's now fixed.

lou
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top