[lazarus] TStrings problem

Jeff Wormsley jwormsley at debitek.com
Wed Jun 2 15:01:36 EDT 1999




*********** REPLY SEPARATOR ***********

On 6/2/99, at 12:44 PM, Baeseman, Cliff wrote: 

>Here is one problem that I ran across lately with the TStrings object.
>
>Code to duplicate the error goes something like this.
>
>var
>string1: TStrings;
>string2: TStrings;
>inif: TIniFile;
>
>procedure buggy;
>begin
>
>  string1 := TStringList.Create;
>  string2 := TStringList.Create;
>  inif := TIniFile.Create('/etc/test.ini');
>
>  inif.ReadSection('PATHS',string1);
>  inif.ReadSection('UNITS',string2);      <----the second reference to a
>TStrings always segs?
>
>end;


Is there any significance to the fact you are declaring TStrings and yet creating TStringLists?  And if this is based on Delphi TStrings, aren't there abstracted methods in TStrings that need to be overidden?  Assuming you just typoed TStrings instead of TStringlist, what exactly is going on with ReadSection?  I take it that it is reading in a group of entries and populating the string list?  What methods of a stringlist are ReadSection calling?  That is where I would concentrate the search, see what ReadSection is doing to the string list, and hand execute the code to see why it segs.

Jeff.

>
>This same problem seems to occur any time I reference more than one TStrings
>at a time. It also happens when passing
>a TStrings object to a property or passing to a procedure and or a reference
>to a global TStrings object.
>
>this is while using the H and I switches and objfpc....
>
>
>This I can hack around but it would be nice if fixed. I would really like to
>use the TIniFile unit.
>
>Cliff
>
>
>
>- "If you kiss me, I'll turn into a beautiful princess."
>- "Look, I'm a computer programmer. I don't have time for girls,
>but a talking frog is very very cool."
>
>
>_________________________________________________________________
>     To unsubscribe: mail lazarus-request at miraclec.com with
>                "unsubscribe" as the Subject
>    archives at http://www.miraclec.com/list_archives/lazarus






More information about the Lazarus mailing list