From b8a63e3ab71e81fa9e312c4ac02911ea5f30fa58 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 8 Apr 2013 00:57:02 +0200 Subject: [PATCH] 2013-04-08 00:56 UTC+0200 Viktor Szakats (harbour syenar.net) * tests/inifiles.prg ! fix to prev --- ChangeLog.txt | 4 ++++ tests/inifiles.prg | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 22e67b07c5..2e996efbef 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,10 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-04-08 00:56 UTC+0200 Viktor Szakats (harbour syenar.net) + * tests/inifiles.prg + ! fix to prev + 2013-04-08 00:52 UTC+0200 Viktor Szakats (harbour syenar.net) * bin/check.hb + will now check for missing copyright/license message diff --git a/tests/inifiles.prg b/tests/inifiles.prg index fc7084b444..3118495451 100644 --- a/tests/inifiles.prg +++ b/tests/inifiles.prg @@ -48,6 +48,35 @@ #include "fileio.ch" #include "hbclass.ch" +PROCEDURE Main( cFilename, cSection ) + + LOCAL oIni + LOCAL s, n + + hb_default( @cFilename, "harbour.ini" ) + hb_default( @cSection, "1" ) + + oIni := TIniFile():New( cFileName ) + n := Val( cSection ) + + ? + ? "Sections:" + s := oIni:ReadSections() + AEval( s, {| x | QOut( "[" + x + "]" ) } ) + + ? + ? "[" + s[ n ] + "]" + s := oIni:ReadSection( s[ n ] ) + AEval( s, {| x | QOut( x ) } ) + + oIni:WriteDate( "Date Test", "Today", Date() ) + oIni:WriteBool( "Bool Test", "True", .T. ) + ? oIni:ReadBool( "Bool Test", "True", .F. ) + + oIni:UpdateFile() + + RETURN + CREATE CLASS TIniFile VAR FileName