Re: [fpc-pascal] Basic question about TStringList

2008-03-27 Thread Crause, Christo (JC)
> From: [EMAIL PROTECTED] > As a consequence I have another question. Suppose I have a function > that returns a TStringList: > > Myfunction(): TStringList; > > I must have inside a line like: > > Result:=TStringList.Create; > > Let A be a TStringList, I have two ways to catch the result >

Re: [fpc-pascal] Basic question about TStringList

2008-03-27 Thread Jonas Maebe
On 27 Mar 2008, at 13:27, [EMAIL PROTECTED] wrote: Let A be a TStringList, I have two ways to catch the result of my function: A:=Myfunction(); or A.Assign(Myfunction()); In the first case, if do A.Free, I release the memory allocated by the function. What's arriving in the second case?

Re: [fpc-pascal] Basic question about TStringList

2008-03-27 Thread g . marcou
Hi, thanks for your very clear answer. In fact this is chilling me as I am thinking to the huge amount of memory leaks that I certainly have in my developements... This means that whenever the assignement operator ":=" is used with TStringLists, the recieving list shall never be created!

Re: [fpc-pascal] Basic question about TStringList

2008-03-27 Thread Andreas Berger
Hi, I seek help to clarify a very basic use of TStringList. Let A and B be TStringLists. What is the difference between: A:=B; and A.Assign(B); ? That's more a basic(?) question about Pascal. When you do A:=B; then A has become equal to B. That means for example that if you add an n

Re: [fpc-pascal] Basic question about TStringList

2008-03-27 Thread Joost van der Sluis
Op donderdag 27-03-2008 om 11:35 uur [tijdzone +0100], schreef [EMAIL PROTECTED]: > Hi, > > I seek help to clarify a very basic use of TStringList. > > Let A and B be TStringLists. What is the difference between: > > A:=B; > > and > > A.Assign(B); ? That's more a basic(?) question about Pasca

[fpc-pascal] Basic question about TStringList

2008-03-27 Thread g . marcou
Hi, I seek help to clarify a very basic use of TStringList. Let A and B be TStringLists. What is the difference between: A:=B; and A.Assign(B); ? Thanks in advance for your help, Gilles Marcou ___ fpc-pascal maillist - fpc-pascal@lists.freepasc