Board index » delphi » StringList := StringList ??
Quarc \(Marc Tricou\)
![]() Delphi Developer |
Sun, 25 Aug 2002 03:00:00 GMT
|
Quarc \(Marc Tricou\)
![]() Delphi Developer |
Sun, 25 Aug 2002 03:00:00 GMT
StringList := StringList ??
Hi!
I just read in the online help of D4 that you copy StringLists bei cu Quarc |
Sundial Service
![]() Delphi Developer |
Sun, 25 Aug 2002 03:00:00 GMT
Re:StringList := StringList ??Maybe I'm from the old school but I still like the "Assign()" method. This makes it abundantly clear what the code is trying to do -- to copy the content of the object from one to another. It takes me a split second more to type the additional 6 ASCII characters to win clarity. Quote>Quarc (Marc Tricou) wrote: Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259 mailto:i...@sundialservices.com (PGP public key available.) Quote> Fast(!), automatic table-repair with two clicks of the mouse! |
Finn Tolderlun
![]() Delphi Developer |
Mon, 26 Aug 2002 03:00:00 GMT
Re:StringList := StringList ??"Quarc (Marc Tricou)" <Qu...@gmx.de> skrev i en meddelelse news:8a6kvh$4n6$1@mail.fh-wedel.de... Quote> I just read in the online help of D4 that you copy StringLists bei But you can copy the strings in the StringList using :=. Quote> Aren't StringLists Objects? Quote> How do I amke a shallow copy now (as the := does with normal objects)? You simply cannot copy objects with :=. Finn Tolderlund |
Ray Lischn
![]() Delphi Developer |
Mon, 26 Aug 2002 03:00:00 GMT
Re:StringList := StringList ??On Wed, 8 Mar 2000 23:41:56 +0100, "Quarc \(Marc Tricou\)" Quote<Qu...@gmx.de> wrote: TStringList) to a TStrings-type property, e.g., Memo1.Lines := ListBox1.Items; copies the strings in the string lists. That's because the property's When you assign an object reference to a variable, you can copying only var Thus, if you are uncertain whether you assigning to a property or to a |
David C. Ullric
![]() Delphi Developer |
Mon, 26 Aug 2002 03:00:00 GMT
Re:StringList := StringList ??Quote"Quarc (Marc Tricou)" wrote: help - what you read in the help was something about assigning _properties_ of type TStrings. When you assign something to a property you are not _really_ type T = class procedure T.SetP(AValue: integer); function T.GetP: integer; procedure TForm1.Button1Click(Sender: TObject); Quote> Aren't StringLists Objects? for example, you there's no way to make a shallow assignment of a stringlist to a Memo.Lines. Because AMemo.Lines is not an object at all - it just looks like one. Quote
Read about properties. Quote
|
Ray Lischn
![]() Delphi Developer |
Tue, 27 Aug 2002 03:00:00 GMT
Re:StringList := StringList ??On Sat, 11 Mar 2000 01:55:24 +0100, "Quarc \(Marc Tricou\)" Quote<Qu...@gmx.de> wrote: fashion. Assignment of an object reference to a variables does NOT perform a shallow copy, according to the standard definition. It copies the reference only. Calling the Assign method performs a shallow copy: it copies the top-level contents of the container, namely, the strings and object references. A deep copy follows the object references and recursively performs a deep copy of all the objects. TStrings does not have a method to do that. Indeed, none of the standard Delphi methods perform a deep copy. -- |
Marc Trico
![]() Delphi Developer |
Wed, 28 Aug 2002 03:00:00 GMT
Re:StringList := StringList ??Hi! What you all wrote is what i always thought: StringLists are normal cu Quarc |
Marc Trico
![]() Delphi Developer |
Wed, 28 Aug 2002 03:00:00 GMT
Re:StringList := StringList ??Hi! Quote> >What you all wrote is what i always thought: StringLists are normal desrcibe the difference between the two ways of copying. Perhaps I should have chosen "reference" and "object" copy. Thank for correction, my terms were misleading. cu Quarc |
1. Stringlists begetting stringlists ??
2. StringList assign exception problem
3. Converting result of query to stringlist
4. Binary Searches on a StringList ?
5. Database Tables vs. StringLists and Text Files
8. q: passing string element of stringlist by ref