From 36067e3accdae5e833db2b65dcc5e3a0868d988a Mon Sep 17 00:00:00 2001 From: "David G. Holm" Date: Sat, 26 Jun 1999 01:24:36 +0000 Subject: [PATCH] See ChangeLog entry 19990625-20:15 EDT David G. Holm --- harbour/ChangeLog | 9 +++++++++ harbour/tests/working/inifiles.prg | 13 ++++++++----- harbour/tests/working/testcgi.prg | 2 +- harbour/tests/working/teststr.prg | 2 +- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b8321b51be..c26463c496 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,12 @@ +19990625-20:15 EDT David G. Holm + * tests/working/inifiles.prg + - Added an error message that displays when the specified section + number is larger than the number of sections in the .INI file + * tests/working/testcgi.prg + - Added test to skip WHILE loop if list.txt couldn't be opened + * tests/working/teststr.prg + - Corrected spelling of _SET_FIXED + Fri Jun 25 18:27:43 1999 Gonzalo A. Diethelm * include/Makefile: diff --git a/harbour/tests/working/inifiles.prg b/harbour/tests/working/inifiles.prg index 44641f3dd0..3e67f48816 100644 --- a/harbour/tests/working/inifiles.prg +++ b/harbour/tests/working/inifiles.prg @@ -10,9 +10,13 @@ function Main(cFilename, cSection) aeval(s, {|x| qout('[' + x + ']')}) qout('') - qout('[' + s[n] + ']') - s := oIni:ReadSection(s[n]) - aeval(s, {|x| qout(x)}) + if(len(s) >= n) + qout('[' + s[n] + ']') + s := oIni:ReadSection(s[n]) + aeval(s, {|x| qout(x)}) + else + qout('No section', n) + endif oIni:WriteDate('Date Test', 'Today', Date() ) oIni:WriteBool('Bool Test', 'True', .t.) @@ -62,6 +66,7 @@ static function New(cFileName) else ::FileName := cFilename ::Contents := {} + CurrArray := ::Contents if File(cFileName) @@ -246,9 +251,7 @@ return aSection static function ReadSections() local Self := QSelf() local i, aSections := {} - for i := 1 to Len(::Contents) - if ValType(::Contents[i][2]) == 'A' AAdd(aSections, ::Contents[i][1]) endif diff --git a/harbour/tests/working/testcgi.prg b/harbour/tests/working/testcgi.prg index e9ce37c5c7..57109869af 100644 --- a/harbour/tests/working/testcgi.prg +++ b/harbour/tests/working/testcgi.prg @@ -38,7 +38,7 @@ FUNCTION Main() cTable := "" // Builds dynamic table replacement - WHILE (nPos := fRead( hFile, @cString, IF_BUFFER )) > 0 + WHILE hFile != -1 .AND. (nPos := fRead( hFile, @cString, IF_BUFFER )) > 0 i := 1 DO WHILE i <= nPos diff --git a/harbour/tests/working/teststr.prg b/harbour/tests/working/teststr.prg index a9c4617d3d..860d99a243 100644 --- a/harbour/tests/working/teststr.prg +++ b/harbour/tests/working/teststr.prg @@ -6,7 +6,7 @@ function main() test() __ACCEPT ("Pause before running again with SET FIXED ON: ") outstd (CHR(13)+CHR(10)) - SET (_SET_SETFIXED, "ON") + SET (_SET_FIXED, "ON") test() return nil