From 17007dabc4e4da41de27c458fd8ca448ea5cd25d Mon Sep 17 00:00:00 2001 From: Eddie Runia Date: Sun, 13 Jun 1999 07:39:11 +0000 Subject: [PATCH] see changelog --- harbour/ChangeLog | 4 ++++ harbour/tests/working/inifiles.prg | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f287355953..cfdf300ab4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +19990612 08:30 CET Matthew Hamilton + * tests/working/inifiles.prg + with ReadBool and WriteBool + 19990612 10:57 PST Ron Pinkas * source/compiler/harbour.y Added check on non used variables to be done at the end of source file so last function will be tested too. diff --git a/harbour/tests/working/inifiles.prg b/harbour/tests/working/inifiles.prg index e8f55dc053..44641f3dd0 100644 --- a/harbour/tests/working/inifiles.prg +++ b/harbour/tests/working/inifiles.prg @@ -15,6 +15,8 @@ function Main(cFilename, cSection) aeval(s, {|x| qout(x)}) oIni:WriteDate('Date Test', 'Today', Date() ) + oIni:WriteBool('Bool Test', 'True', .t.) + qout( oIni:ReadBool('Bool Test', 'True', .f.) ) oIni:UpdateFile() return nil @@ -35,6 +37,8 @@ function TIniFile() oClass:AddMethod( "WriteNumber", @WriteNumber() ) oClass:AddMethod( "ReadDate", @ReadDate() ) oClass:AddMethod( "WriteDate", @WriteDate() ) + oClass:AddMethod( "ReadBool", @ReadBool() ) + oClass:AddMethod( "WriteBool", @WriteBool() ) oClass:AddMethod( "ReadSection", @ReadSection() ) oClass:AddMethod( "ReadSections", @ReadSections() ) oClass:AddMethod( "DeleteKey", @DeleteKey() ) @@ -184,6 +188,18 @@ static procedure WriteDate(cSection, cIdent, dDate) ::WriteString( cSection, cIdent, DToS(dDate) ) return +static function ReadBool(cSection, cIdent, lDefault) + local Self := QSelf() + local cDefault := Iif( lDefault, '.t.', '.f.' ) + +return ::ReadString(cSection, cIdent, cDefault) == '.t.' + +static procedure WriteBool(cSection, cIdent, lBool) + local Self := QSelf() + + ::WriteString( cSection, cIdent, Iif(lBool, '.t.', '.f.') ) +return + static procedure DeleteKey(cSection, cIdent) local Self := QSelf() local j, i := AScan( ::Contents, {|x| x[1] == cSection} )