BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Is this true method?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design
View previous topic :: View next topic  
Author Message
FeliXus
Guest





PostPosted: Fri Feb 16, 2007 3:34 pm    Post subject: Is this true method? Reply with quote



//Hi all...
//-------------------------

Type
TRec = Record
Name, Surname : String[20];
End;

Type
Athread=Class(TThread)
Constructor Create;
Public
OList : TObjectList;
End;

Procedure AThread.Create;
Begin
OList : TObjectList.Create;
OList.OwnsObjects := True;
Inherited create (True);
End;

Procedure AThread.ListAdd;
Var
Str : TMemoryStream;
Rec : TRec;
Begin
Rec.Name :='AAA';
Rec.SurName :='BBB';

Str := TMemoryStream.Create;

OList.Add(Str);
// I am not free Str
End;

Procedure AThread.ListRead;
Var
I : Integer;
Rec : TRec;
Begin
For I:=0 to OList.Count-1 do
Begin
TMemoryStream(Olist[0]).Read(Rec, Sizeof(TRec));
.........
........
Olist.Delete(0);
// I am not free any record or Stream, is TObjectList free and nil
Str (on the AThread.ListAdd) when I delete OList[0]?
// Is this true method for queu?
End;
End;
Back to top
Joanna Carter [TeamB]
Guest





PostPosted: Fri Feb 16, 2007 4:41 pm    Post subject: Re: Is this true method? Reply with quote



"FeliXus" <bilcan [at] gmail.com> a écrit dans le message de news:
45d57a9e$1 (AT) newsgroups (DOT) borland.com...

Please do not cross-post, this question does not belong in this group which
is for OO design issues. Please choose only one group in future.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Back to top
Marc Rohloff [TeamB]
Guest





PostPosted: Fri Feb 16, 2007 7:50 pm    Post subject: Re: Is this true method? Reply with quote



On Fri, 16 Feb 2007 10:41:57 -0000, Joanna Carter [TeamB] wrote:

Quote:
Please do not cross-post, this question does not belong in this group which
is for OO design issues. Please choose only one group in future.

Nor is non-technical group a good place to post questions either. You
are sure to get better answers by posting in an appropriate group lige
delphi.language.delphi.win32 or delphi.rtl.

--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.