diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2b89758b22..5f6bcae45a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,19 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-04 04:56 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/gtwvg/tests/dyndlgs.prg + * contrib/gtwvg/tests/wvtcls.prg + * contrib/hbgd/tests/test_out.prg + * contrib/hbhpdf/tests/harupdf.prg + * contrib/hbhttpd/core.prg + * doc/en/set.txt + * extras/guestbk/guestbk.prg + * extras/guestbk/inifiles.prg + * extras/guestbk/testcgi.prg + * extras/httpsrv/modules/tableservletdb.prg + * formatting and EOL related cleanups + 2012-10-04 04:21 UTC+0200 Viktor Szakats (harbour syenar.net) * extras/httpsrv/home/index.html * updated reference to long deleted batch file to hbmk2 cmdline diff --git a/harbour/contrib/gtwvg/tests/dyndlgs.prg b/harbour/contrib/gtwvg/tests/dyndlgs.prg index d00db9cce5..b40ff2c840 100644 --- a/harbour/contrib/gtwvg/tests/dyndlgs.prg +++ b/harbour/contrib/gtwvg/tests/dyndlgs.prg @@ -39,11 +39,7 @@ // -#define CRLF chr( 13 )+chr( 10 ) - -// - -thread static t_aSlides := {} +THREAD STATIC t_aSlides := {} // @@ -280,7 +276,7 @@ STATIC FUNCTION GetEditText() LOCAL cText := "" cText += "Welcome in the Wonderful World of Harbour!" - cText += CRLF + CRLF + cText += hb_eol() + hb_eol() cText += "When Peter Rees first published GTWVT, a Windows " cText += "Terminal Driver, on 22 Dec 2003, everybody took it " cText += "lightly, except for me, as I was aware that what " @@ -288,11 +284,11 @@ STATIC FUNCTION GetEditText() cText += "what immense possibilities he has opened for Harbour " cText += "developers, what limitations he has cleared for Clipper " cText += "savvy user base." - cText += CRLF + CRLF + cText += hb_eol() + hb_eol() cText += "With a little effort I could extend GTWVT " cText += "to give it a GUI look. I also tried to give it " cText += "an event driven functionality, and up came Wvt*Classes." - cText += CRLF + CRLF + cText += hb_eol() + hb_eol() cText += "And yet another feather is added in the cap of GTWVT " cText += "as it is now capable of firing modeless dialogs like the one " cText += "you are viewing. These dialogs can be constructed dynamically ( Courtesy hbwhat32 ) " @@ -300,8 +296,8 @@ STATIC FUNCTION GetEditText() cText += "can be active at any given time. Also note that dialogs created " cText += "dynamically respect Top, Left, Rows, Cols coordinates, which is an " cText += "undisputed productivity boost!" - cText += CRLF + CRLF - cText += "Enjoy!" + CRLF + cText += hb_eol() + hb_eol() + cText += "Enjoy!" + hb_eol() cText += "Pritpal Bedi, INDIA" RETURN cText diff --git a/harbour/contrib/gtwvg/tests/wvtcls.prg b/harbour/contrib/gtwvg/tests/wvtcls.prg index 77ac4ee593..1077612214 100644 --- a/harbour/contrib/gtwvg/tests/wvtcls.prg +++ b/harbour/contrib/gtwvg/tests/wvtcls.prg @@ -22,10 +22,6 @@ // -#define CRLF chr( 13 )+chr( 10 ) - -// - FUNCTION DialogWvgClassesOne( nMode ) Local bBlock @@ -70,15 +66,15 @@ STATIC FUNCTION MyDialogOne( oCrt ) hPopup := Wvt_SetPopupMenu() Popups() - cTxt := "GtWvt is capable of designing virtually any preceivable control " + cTxt := "GTWVG is capable of designing virtually any preceivable control " cTxt := cTxt + "Windows offers." - cTxt := cTxt + CRLF + CRLF + cTxt := cTxt + hb_eol() + hb_eol() cTxt := cTxt + "This text is placed in a WvtTextBox() control with " cTxt := cTxt + "font and alignment adjustments!" - cTxt := cTxt + CRLF + CRLF + cTxt := cTxt + hb_eol() + hb_eol() cTxt := cTxt + "Enjoy - Pritpal Bedi, INDIA" - aImg_:={} + aImg_ := {} aadd( aImg_, GetResource( "v_lock.bmp" ) ) aadd( aImg_, GetResource( "v_new.bmp" ) ) aadd( aImg_, GetResource( "v_clclt.bmp" ) ) diff --git a/harbour/contrib/hbgd/tests/test_out.prg b/harbour/contrib/hbgd/tests/test_out.prg index ab6e699d3f..43a7732204 100644 --- a/harbour/contrib/hbgd/tests/test_out.prg +++ b/harbour/contrib/hbgd/tests/test_out.prg @@ -10,7 +10,9 @@ #include "gd.ch" -#command WRITE => FWrite( 1, + CHR( 13 ) + CHR( 10 ) ) +#define CRLF ( Chr( 13 ) + Chr( 10 ) ) + +#command WRITE => FWrite( 1, + CRLF ) #command OutHTML => WRITE PROCEDURE Main( ... ) @@ -110,7 +112,7 @@ PROCEDURE StartHTML( cTitle ) WRITE 'content-type: text/html' WRITE 'Pragma: no-cache' - WRITE Chr( 13 ) + Chr( 10 ) + WRITE CRLF WRITE "" WRITE "" WRITE "" + cTitle + "" @@ -147,7 +149,7 @@ PROCEDURE OutPhoto( cPhoto, nWidth, nHeight ) //__OutDebug( hb_dumpvar( oImage ) ) - WRITE 'content-type: ' + oImage:cMime + Chr( 13 ) + Chr( 10 ) + WRITE 'content-type: ' + oImage:cMime + CRLF cType := oImage:cType DO CASE @@ -211,7 +213,7 @@ PROCEDURE OutJpg( cText, nPitch ) //oI:SetColor( blue ) //oI:Say( 0, 0, cText ) - WRITE 'content-type: image/jpeg' + Chr( 13 ) + Chr( 10 ) + WRITE 'content-type: image/jpeg' + CRLF oI:OutputJpeg() diff --git a/harbour/contrib/hbhpdf/tests/harupdf.prg b/harbour/contrib/hbhpdf/tests/harupdf.prg index 9c51dad2ca..903fc4d6cc 100644 --- a/harbour/contrib/hbhpdf/tests/harupdf.prg +++ b/harbour/contrib/hbhpdf/tests/harupdf.prg @@ -1240,7 +1240,7 @@ STATIC FUNCTION Page_Annotation( pdf ) annot := HPDF_Page_CreateTextAnnot( page, rect1, ; - "Annotation with Comment Icons" + Chr( 13 ) + Chr( 10 ) + ; + "Annotation with Comment Icons" + hb_eol() + ; "This annotation set to be opened initially.", ; NIL ) diff --git a/harbour/contrib/hbhttpd/core.prg b/harbour/contrib/hbhttpd/core.prg index 2ab1bbf496..e60cc7170e 100644 --- a/harbour/contrib/hbhttpd/core.prg +++ b/harbour/contrib/hbhttpd/core.prg @@ -918,7 +918,7 @@ STATIC FUNCTION MakeResponse( hConfig ) t_cResult := "

" + cStatus + "

" ENDIF UAddHeader( "Content-Length", hb_ntos( Len( t_cResult ) ) ) - AEval( t_aHeader, {| x | cRet += x[1] + ": " + x[2] + CR_LF } ) + AEval( t_aHeader, {| x | cRet += x[ 1 ] + ": " + x[ 2 ] + CR_LF } ) cRet += CR_LF Eval( hConfig[ "Trace" ], cRet ) cRet += t_cResult diff --git a/harbour/doc/en/set.txt b/harbour/doc/en/set.txt index bf55df2dc4..204debdbe2 100644 --- a/harbour/doc/en/set.txt +++ b/harbour/doc/en/set.txt @@ -538,8 +538,8 @@ * $EXAMPLES$ * // Set F1 with a string * CLS - * Set Function 1 to "I Am Lazy" + CHR( 13 ) - * cTest := SPACE( 20 ) + * SET FUNCTION 1 TO "I Am Lazy" + Chr( 13 ) + * cTest := Space( 20 ) * @ 10, 0 SAY "type something or F1 for lazy mode " GET cTest * READ * ? cTest diff --git a/harbour/extras/guestbk/guestbk.prg b/harbour/extras/guestbk/guestbk.prg index 45159dd44e..8b98f01ea0 100644 --- a/harbour/extras/guestbk/guestbk.prg +++ b/harbour/extras/guestbk/guestbk.prg @@ -48,8 +48,8 @@ * If you write modifications of your own for Harbour, it is your choice * whether to permit this exception to apply to your modifications. * If you do not wish that, delete this exception notice. - -*/ + * + */ FUNCTION Main() @@ -72,7 +72,7 @@ FUNCTION Main() cField := oIni:ReadString( "Header", "DataField" + hb_ntos( i ), "" ) oIni:WriteString( "Entries", cField + hb_ntos( nEntry ), ; - StrTran( StrTran( oHTML:QueryFields( cField ), Chr( 10 ), "" ), Chr( 13 ), "
" ) ) + StrTran( StrTran( oHTML:QueryFields( cField ), Chr( 13 ) ), Chr( 10 ), "
" ) ) NEXT @@ -128,7 +128,7 @@ FUNCTION Main() // Formats each line according to the INI file FOR i := 1 TO Len( aEntries ) - cCode += "" + Chr( 13 ) + Chr( 10 ) + cCode += "
" + hb_eol() cColor := iif( Mod( i, 2 ) == 0, cEvenColor, cOddColor ) FOR j := 1 TO oIni:ReadNumber( "Format", "FormatLines", 0 ) @@ -144,11 +144,11 @@ FUNCTION Main() cLine := StrTran( cLine, "<#DateTime>", ; oIni:ReadString( "Entries", "DateTime" + hb_ntos( Len(aEntries ) - i + 1 ), "" ) ) - cCode += cLine + "" + Chr( 13 ) + Chr( 10 ) + cCode += cLine + "" + hb_eol() NEXT - cCode += "
" + Chr( 13 ) + Chr( 10 ) + cCode += "" + hb_eol() NEXT diff --git a/harbour/extras/guestbk/inifiles.prg b/harbour/extras/guestbk/inifiles.prg index b5cf6467a1..a3ed42af34 100644 --- a/harbour/extras/guestbk/inifiles.prg +++ b/harbour/extras/guestbk/inifiles.prg @@ -2,6 +2,8 @@ * $Id$ */ +#include "fileio.ch" + FUNCTION TIniFile() STATIC oClass @@ -48,8 +50,8 @@ STATIC FUNCTION New( cFileName ) ::Contents := {} CurrArray := ::Contents - IF File( cFileName ) - hFile := FOpen( cFilename, 0 ) + IF hb_FileExists( cFileName ) + hFile := FOpen( cFilename, FO_READ ) ELSE hFile := FCreate( cFilename ) ENDIF @@ -60,12 +62,12 @@ STATIC FUNCTION New( cFileName ) cFile := Space( 256 ) Done := ( FRead( hFile, @cFile, 256 ) <= 0 ) - cFile := StrTran( cFile, Chr( 10 ), "" ) // so we can just search for CHR(13) + cFile := StrTran( cFile, Chr( 13 ) ) // so we can just search for Chr( 10 ) // prepend last read cFile := cLine + cFile WHILE ! Empty( cFile ) - IF ( nPos := At( Chr(13 ), cFile ) ) > 0 + IF ( nPos := At( Chr( 10 ), cFile ) ) > 0 cLine := Left( cFile, nPos - 1 ) cFile := SubStr( cFile, nPos + 1 ) @@ -161,7 +163,7 @@ STATIC PROCEDURE WriteString( cSection, cIdent, cString ) ELSE cFind := Lower( cSection ) - IF ( i := AScan( ::Contents, {| x | HB_ISSTRING(x[ 1 ] ) .AND. Lower(x[ 1 ] ) == cFind .AND. HB_ISARRAY(x[ 2 ] ) } ) ) > 0 + IF ( i := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cFind .AND. HB_ISARRAY( x[ 2 ] ) } ) ) > 0 cFind := Lower( cIdent ) j := AScan( ::Contents[ i ][ 2 ], {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cFind } ) @@ -252,7 +254,7 @@ STATIC PROCEDURE EraseSection( cSection ) ELSE cSection := Lower( cSection ) - IF ( i := AScan( ::Contents, {| x | HB_ISSTRING(x[ 1 ] ) .AND. Lower(x[ 1 ] ) == cSection .AND. HB_ISARRAY(x[ 2 ] ) } ) ) > 0 + IF ( i := AScan( ::Contents, {| x | HB_ISSTRING( x[ 1 ] ) .AND. Lower( x[ 1 ] ) == cSection .AND. HB_ISARRAY( x[ 2 ] ) } ) ) > 0 ADel( ::Contents, i ) ASize( ::Contents, Len( ::Contents ) - 1 ) ENDIF @@ -310,22 +312,22 @@ STATIC PROCEDURE UpdateFile() FOR i := 1 TO Len( ::Contents ) if ::Contents[ i ][ 1 ] == NIL - FWrite( hFile, ::Contents[ i ][ 2 ] + Chr( 13 ) + Chr( 10 ) ) + FWrite( hFile, ::Contents[ i ][ 2 ] + hb_eol() ) ELSEIF HB_ISARRAY( ::Contents[ i ][ 2 ] ) - FWrite( hFile, "[" + ::Contents[ i ][ 1 ] + "]" + Chr( 13 ) + Chr( 10 ) ) + FWrite( hFile, "[" + ::Contents[ i ][ 1 ] + "]" + hb_eol() ) FOR j := 1 TO Len( ::Contents[ i ][ 2 ] ) if ::Contents[ i ][ 2 ][ j ][ 1 ] == NIL - FWrite( hFile, ::Contents[ i ][ 2 ][ j ][ 2 ] + Chr( 13 ) + Chr( 10 ) ) + FWrite( hFile, ::Contents[ i ][ 2 ][ j ][ 2 ] + hb_eol() ) ELSE - FWrite( hFile, ::Contents[ i ][ 2 ][ j ][ 1 ] + "=" + ::Contents[ i ][ 2 ][ j ][ 2 ] + Chr( 13 ) + Chr( 10 ) ) + FWrite( hFile, ::Contents[ i ][ 2 ][ j ][ 1 ] + "=" + ::Contents[ i ][ 2 ][ j ][ 2 ] + hb_eol() ) ENDIF NEXT - FWrite( hFile, Chr( 13 ) + Chr( 10 ) ) + FWrite( hFile, hb_eol() ) ELSEIF HB_ISSTRING( ::Contents[ i ][ 2 ] ) - FWrite( hFile, ::Contents[ i ][ 1 ] + "=" + ::Contents[ i ][ 2 ] + Chr( 13 ) + Chr( 10 ) ) + FWrite( hFile, ::Contents[ i ][ 1 ] + "=" + ::Contents[ i ][ 2 ] + hb_eol() ) ENDIF NEXT diff --git a/harbour/extras/guestbk/testcgi.prg b/harbour/extras/guestbk/testcgi.prg index 0443915aac..bc8c6db205 100644 --- a/harbour/extras/guestbk/testcgi.prg +++ b/harbour/extras/guestbk/testcgi.prg @@ -179,10 +179,10 @@ STATIC FUNCTION Generate() // Is this a meta file or hand generated script? IF Empty( ::cHTMLFile ) - ::cContent := ; + ::cContent := ; "" + hb_eol() + ; "" + ::cTitle + "" + hb_eol() + ; - "" + + hb_eol() + ; ::cBody + hb_eol() + ; "" diff --git a/harbour/extras/httpsrv/modules/tableservletdb.prg b/harbour/extras/httpsrv/modules/tableservletdb.prg index cada9cca57..0e200e3d9d 100644 --- a/harbour/extras/httpsrv/modules/tableservletdb.prg +++ b/harbour/extras/httpsrv/modules/tableservletdb.prg @@ -52,7 +52,6 @@ #include "hbclass.ch" -#define CRLF ( chr( 13 ) + chr( 10 ) ) #define TABLE_NAME_PATH ".." + hb_ps() + ".." + hb_ps() + ".." + hb_ps() + "tests" + hb_ps() + "test.dbf" #define SIMULATE_SLOW_REPLY @@ -317,7 +316,7 @@ METHOD getXmlCount( nCount ) CLASS TableManager xml:append( "" ) FOR n := 1 TO nPages - xml:append( "" + LTrim( Str( n ) ) + "" ) + xml:append( "" + hb_ntos( n ) + "" ) NEXT xml:append( "" ) @@ -369,10 +368,10 @@ METHOD xmlEncode( input ) CLASS TableManager CASE '>' out += ">" EXIT - //case ' ' - // out += " " - // exit - CASE Chr( 9 ) //E'\t' +// CASE ' ' +// out += " " +// EXIT + CASE Chr( 9 ) //E'\t' CASE Chr( 13 ) //E'\r' CASE Chr( 10 ) //E'\n' out += c @@ -408,6 +407,6 @@ METHOD ToString() CLASS BasicXML LOCAL s := "" - AEval( ::aData, {| c | s += c + iif( Right( c, 1 ) == ">", CRLF, "" ) } ) + AEval( ::aData, {| c | s += c + iif( Right( c, 1 ) == ">", hb_eol(), "" ) } ) RETURN s