Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-04

TinitFile Bug perhaps?

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael A. Hess
to Michael Van Canneyt: Michael (H. :) ) I added a line TS.Add(''); to the test program I sent you, and it still…
Michael Van Canneyt wrote 5 lines
I added a line TS.Add(''); to the test program I sent you, and it still works; So this indicates that the error is probably elsewhere...

I'll will play with it some more to find the exact cause for you however it is related to the empty string issue. I did another test and in one instance with the (' ') it worked fine but when it was ('') I had to abort the program and it had written a file over 92Meg in size. It wouldn't have stopped until I ran out of disk space.

Talk at you later,

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Cliff Baeseman

Michael,

I created a decendent class of type TIniFile called TProject. I used your same create and also created another procedure called SetProjectName(fname: string). I pass a file name to create and the file gets created but when I call my SetProjectName which just passes the name to WriteString(''NAMES,'PROJECT',fName)....I get an unhandled exception and a Out Of Memory error is thrown. I am using this for a path name '/development/lazarus/projects/lazarus.csp'. Like I said the file is created but the entry is not created.

I am trying to use this unit to create lazarus project files. BTW we do have the color source editor sort of working Shane is ironing it out now. I am working the compiler and project issues. Like creation of the project files and integrating the compiler, we should finish around the same time.

Thanx

Cliff

Reply by email

Michael A. Hess
to Cliff Baeseman
Cliff Baeseman wrote
I get an unhandled exception and a Out Of Memory error is thrown.

I found the problem. To put a line space in the sequence I was adding an empty string to the TStringList. This used to work. I guess with AnsiStrings it causes a problem now. I have indicated the problem to Michael and I let you know when the FCL is fixed.

Talk at you later,

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael A. Hess
to Cliff Baeseman: I created a decendent class of type TIniFile called TProject. I used your same create…
Cliff Baeseman wrote
Michael,

We have got tooooo many Michaels on this project. You can never be quite sure which one someone is talking about or to. Since I contributed TIniFiles I guess I'll field this. :-)

I get an unhandled exception and a Out Of Memory error is thrown.

TIniFiles uses TStringList extensively. I was just writing some code for another product using TStringList and was getting this same kind of error. I reported it to Michael (see what I mean about names) and he indicated that there was a bug. He told me he couldn't commit and test it because he couldn't recompile the FCL with the new snapshot. I'm not sure if this is what is causing your problem or not.

I'll write up a test program tomorrow to see if I can recreate your problem. The TIniFiles class is right from my Delphi code which I use ALOT and it doesn't have any problems. I can only assume it is some inconsistency with FPC.

Talk at you later,

Spam. spam, spam, spam, spam, bake beans and spam? Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Michael Van Canneyt
to Michael A. Hess: I found the problem. To put a line space in the sequence I was adding an empty string to…
Michael A. Hess wrote 8 lines
Cliff Baeseman wrote: > > I get an unhandled exception and a Out Of Memory error is thrown. I found the problem. To put a line space in the sequence I was adding an empty string to the TStringList. This used to work. I guess with AnsiStrings it causes a problem now. I have indicated the problem to Michael and I let you know when the FCL is fixed.

Michael (H. :) )

I added a line
  TS.Add('');
to the test program I sent you, and it still works;
So this indicates that the error is probably elsewhere...

Michael.

PS. I attached the modified program for those that don't have it. You should call it testd.pp, or you'll end up with troubles :)

program testd;
uses classes;
Var TS : TStringlist;
    i : longint;
begin
  TS:=TStringList.Create;
  TS.Add('');
  TS.Add('String 1');
  TS.Add('String 2');
  For I:=1 to TS.Count do
    Writeln (i,': ',TS.Strings[I-1]);
  Writeln (TS.Text);
  TS.Clear;
  TS.LoadFromFile('testd.pp');
  Writeln ('Count : ',TS.Count);
  For I:=1 to TS.Count do
    Writeln (I,': ',TS.Strings[I-1]);
  Writeln (TS.TExt);
end.

Reply by email