Sign in Join

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

Mailing lists / lazarus / 2010-05

TIniFile bug?

12 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

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

Kjow

I have a problem with TIniFile, it doesn't work.
Until some revisions ago (2-3 days) no problem, but from yesterday it doesn't work anymore.

...
  FileINI :  TIniFile;
...
FileCFG:= 'data.ini';
...
  FileINI := TIniFile.Create(FileCFG);
  FileINI.UpdateFile;
  try
    var1 := FileINI.ReadInteger('sect1','data1',10); //always return 10
    var2 := FileINI.ReadInteger('sect1','data2',11); //always return 11
    var3 := FileINI.ReadInteger('sect2','data3',12); //always return 12
    var4 := FileINI.ReadInteger('sect2','data4',13); //always return 13
  finally
    FileINI.Free;
  end;
...

Thanks!

Reply by email

Michael Van Canneyt
to Kjow: I have a problem with TIniFile, it doesn't work. Until some revisions ago (2-3 days) no…

Probably caused by:

------------------------------------------------------------------------ r15280 | Almindor | 2010-05-16 12:35:42 +0200 (Sun, 16 May 2010) | 2 lines

* apply quoting patch for inifile from A. Klein

------------------------------------------------------------------------

Please enter a bug report in the FPC bugtracker (not Lazarus bugtracker).

Michael.

Kjow wrote 30 lines
I have a problem with TIniFile, it doesn't work. Until some revisions ago (2-3 days) no problem, but from yesterday it doesn't work anymore. ... FileINI : TIniFile; ... FileCFG:= 'data.ini'; ... FileINI := TIniFile.Create(FileCFG); FileINI.UpdateFile; try var1 := FileINI.ReadInteger('sect1','data1',10); //always return 10 var2 := FileINI.ReadInteger('sect1','data2',11); //always return 11 var3 := FileINI.ReadInteger('sect2','data3',12); //always return 12 var4 := FileINI.ReadInteger('sect2','data4',13); //always return 13 finally FileINI.Free; end; ... Thanks! -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Kjow
to Michael Van Canneyt: Probably caused by: ----------------------------------------------------------------------…

2010/5/18 Michael Van Canneyt :

Show quoted text 13 lines
Probably caused by: ------------------------------------------------------------------------ r15280 | Almindor | 2010-05-16 12:35:42 +0200 (Sun, 16 May 2010) | 2 lines * apply quoting patch for inifile from A. Klein ------------------------------------------------------------------------ Please enter a bug report in the FPC bugtracker (not Lazarus bugtracker). Michael.

ok:
http://bugs.freepascal.org/view.php?id=16512

Regards,
Kjow

Reply by email

shoKwave
to Kjow
Kjow wrote 10 lines
2010/5/18 shoKwave: > I had problems with TInifile.ReadString. See > http://bugs.freepascal.org/view.php?id=16502 > TInifile.ReadBool also doesn't work. Maybe all the read-system doesn't works, on WriteInteger/WriteBool it works.

ReadBool, ReadInteger, and so on are using ReadString. So it's all based on the same (simple?) ReadString-bug.
I've made a patch which works for me, but there may be other side-effects I don't oversee. So someone with more skills should have a look at.

Reply by email

Graeme Geldenhuys
to shoKwave
shoKwave wrote
I've made a patch which works for me, but there may be other side-effects I don't oversee. So someone with more skills should have a look at.

Doesn't FPC have unit tests for RTL supplied classes like TIniFile?

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 6 lines
On 18 May 2010 16:18, shoKwave wrote: > > I've made a patch which works for me, but there may be other side-effects I > don't oversee. So someone with more skills should have a look at. Doesn't FPC have unit tests for RTL supplied classes like TIniFile?

TiniFile pre-dates the concept of unit testing.

But if someone cares to make a test: please !!

Michael.

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 8 lines
On 18 May 2010 16:50, Michael Van Canneyt wrote: > > TiniFile pre-dates the concept of unit testing. > > But if someone cares to make a test: please !! Can we use FPCUnit or must it be one of those strange FPC-style tests programs?

You can use fpcunit. (I didn't imagine it any other way)

Michael.

Reply by email