From 06fe543d3969c62089ac17dbe8cfbdff06fbc763 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 12 Oct 2012 09:27:09 +0000 Subject: [PATCH] 2012-10-12 11:16 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbgd/gdbarcod.prg % AllTrim() removed from around Str( n, 1 ) * TOFIX? added to gdbarcod.prg in one place where Str( n, 1 ) is used and the value can be 10. ; Francesco, can you look at it? * contrib/gtwvg/tests/dyndlgs.prg * extras/hbxlsxml/tests/example.prg * tests/ac_test.prg * tests/aliaslck.prg * tests/gtstdtst.prg * tests/rto_get.prg * tests/rto_tb.prg * tests/teststr.prg * *LTRIM(STR()) -> hb_ntos() including cases where a size limit was used, but it was unnecessary. #define added for Clipper where needed. * contrib/hbnf/ntow.prg % LTrim( Str( n, 0 ) ) -> hb_ntos() zero is currected to 10 by runtime. Plus minor opt. * contrib/hbnf/acctmnth.prg * contrib/hbnf/acctqtr.prg * contrib/hbnf/acctweek.prg * contrib/hbnf/dayofyr.prg * contrib/hbnf/month.prg * contrib/hbnf/qtr.prg * contrib/hbnf/week.prg % PAD(*TRIM(STR()),,"0") -> StrZero() * extras/hbxlsxml/xlsxml_s.prg * extras/hbxlsxml/xlsxml_y.prg * extras/hbxlsxml/xlsxml.prg * website/samples/dates3.prg.html * website/samples/dates4.prg.html * website/samples/testcgi.prg.html * website/samples/testhtml.prg.html * hb_osnewline() -> hb_eol() --- harbour/ChangeLog | 43 +++++++++++++++++++++++ harbour/contrib/gtwvg/tests/dyndlgs.prg | 2 +- harbour/contrib/hbgd/gdbarcod.prg | 20 +++++------ harbour/contrib/hbnf/acctmnth.prg | 2 +- harbour/contrib/hbnf/acctqtr.prg | 2 +- harbour/contrib/hbnf/acctweek.prg | 3 +- harbour/contrib/hbnf/dayofyr.prg | 2 +- harbour/contrib/hbnf/month.prg | 2 +- harbour/contrib/hbnf/ntow.prg | 6 +--- harbour/contrib/hbnf/qtr.prg | 2 +- harbour/contrib/hbnf/week.prg | 3 +- harbour/extras/hbxlsxml/tests/example.prg | 2 +- harbour/extras/hbxlsxml/xlsxml.prg | 40 ++++++++++----------- harbour/extras/hbxlsxml/xlsxml_s.prg | 32 ++++++++--------- harbour/extras/hbxlsxml/xlsxml_y.prg | 22 ++++++------ harbour/tests/ac_test.prg | 6 +++- harbour/tests/aliaslck.prg | 4 +-- harbour/tests/gtstdtst.prg | 20 ++++++----- harbour/tests/rto_get.prg | 19 +++++----- harbour/tests/rto_tb.prg | 19 +++++----- harbour/tests/teststr.prg | 2 +- harbour/website/samples/dates3.prg.html | 2 +- harbour/website/samples/dates4.prg.html | 2 +- harbour/website/samples/testcgi.prg.html | 16 ++++----- harbour/website/samples/testhtml.prg.html | 2 +- 25 files changed, 161 insertions(+), 114 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b9acf8538f..d6181daf2a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,49 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-12 11:16 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/hbgd/gdbarcod.prg + % AllTrim() removed from around Str( n, 1 ) + * TOFIX? added to gdbarcod.prg in one place where + Str( n, 1 ) is used and the value can be 10. + ; Francesco, can you look at it? + + * contrib/gtwvg/tests/dyndlgs.prg + * extras/hbxlsxml/tests/example.prg + * tests/ac_test.prg + * tests/aliaslck.prg + * tests/gtstdtst.prg + * tests/rto_get.prg + * tests/rto_tb.prg + * tests/teststr.prg + * *LTRIM(STR()) -> hb_ntos() + including cases where a size limit was used, but + it was unnecessary. + #define added for Clipper where needed. + + * contrib/hbnf/ntow.prg + % LTrim( Str( n, 0 ) ) -> hb_ntos() + zero is currected to 10 by runtime. + Plus minor opt. + + * contrib/hbnf/acctmnth.prg + * contrib/hbnf/acctqtr.prg + * contrib/hbnf/acctweek.prg + * contrib/hbnf/dayofyr.prg + * contrib/hbnf/month.prg + * contrib/hbnf/qtr.prg + * contrib/hbnf/week.prg + % PAD(*TRIM(STR()),,"0") -> StrZero() + + * extras/hbxlsxml/xlsxml_s.prg + * extras/hbxlsxml/xlsxml_y.prg + * extras/hbxlsxml/xlsxml.prg + * website/samples/dates3.prg.html + * website/samples/dates4.prg.html + * website/samples/testcgi.prg.html + * website/samples/testhtml.prg.html + * hb_osnewline() -> hb_eol() + 2012-10-12 10:25 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbhpdf/tests/harupdf.prg * contrib/hbmisc/numtxthu.prg diff --git a/harbour/contrib/gtwvg/tests/dyndlgs.prg b/harbour/contrib/gtwvg/tests/dyndlgs.prg index 588d1d2d24..194afa6f38 100644 --- a/harbour/contrib/gtwvg/tests/dyndlgs.prg +++ b/harbour/contrib/gtwvg/tests/dyndlgs.prg @@ -52,7 +52,7 @@ FUNCTION DynWinDialog( nInfo ) nStyle := DS_SETFONT + WS_VISIBLE + WS_POPUP + WS_CAPTION + WS_SYSMENU + WS_THICKFRAME + WS_MINIMIZEBOX aDlg := Wvt_MakeDlgTemplate( 1, 4, 21, 60, { 0, 0, 0, 0 }, ; - "Dialog First [ " + LTrim( Str( nInfo, 10, 0 ) ) + " ] " + ; + "Dialog First [ " + hb_ntos( nInfo ) + " ] " + ; iif( nInfo % 2 == 0, "Modeless", "Modal" ), " Dialog !", nStyle ) // Multi line edit control diff --git a/harbour/contrib/hbgd/gdbarcod.prg b/harbour/contrib/hbgd/gdbarcod.prg index 02fb4bf173..5969704b72 100644 --- a/harbour/contrib/hbgd/gdbarcod.prg +++ b/harbour/contrib/hbgd/gdbarcod.prg @@ -227,7 +227,7 @@ METHOD Draw13( cText ) CLASS TCode FOR ii := 1 TO Len( ::text ) // Calculate check digit - IF Mod( ( (Len(::text ) + 1 ) - ii ), 2 ) == 0 + IF Mod( ( Len( ::text ) + 1 ) - ii, 2 ) == 0 nchkSum := nchkSum + Int( Val( SubStr(::text, ii, 1 ) ) ) ELSE nchkSum := nchkSum + Int( Val( SubStr( ::text, ii, 1 ) ) ) * 3 @@ -250,7 +250,7 @@ METHOD Draw13( cText ) CLASS TCode IF ii > 1 .AND. ii < 8 - ::DrawSingleBar( iif( SubStr(xParity, ii - 1, 1 ) == "E",; + ::DrawSingleBar( iif( SubStr( xParity, ii - 1, 1 ) == "E",; ::LeftHand_Even[ jj ], ; ::LeftHand_Odd[ jj ] ) ) ELSEIF ii > 1 .AND. ii >= 8 @@ -280,7 +280,7 @@ METHOD Draw13( cText ) CLASS TCode ::lastX := ::positionX ::lastY := ::maxHeight - ctext += AllTrim( Str( nChk, 1 ) ) + ctext += Str( nChk, 1 ) // TOFIX? nChk can be 10 at this point, is this intended? // Draw Text IF ::lDrawValue @@ -298,13 +298,13 @@ METHOD DrawText13() CLASS TCode IF ::textfont != 0 - ::Say( 2, ::maxHeight - ( ::GetFontHeight() / 2 ), SubStr( ::text,1,1 ) , ::FillColor ) - ::Say( ( 10 + (3 * ::res + 48 * ::res )/2 ) - ( ::GetFontWidth() * (6/2 ) ), ::maxHeight + 1, SubStr( ::text,2,6 ), ::FillColor ) - ::Say( 10 + 46 * ::res + ( 3 * ::res + 46 * ::res )/2 - ::GetFontWidth() * ( 6/2 ), ::maxHeight + 1, SubStr( ::text,8,6 ), ::FillColor ) + ::Say( 2, ::maxHeight - ( ::GetFontHeight() / 2 ), SubStr( ::text, 1, 1 ) , ::FillColor ) + ::Say( ( 10 + ( 3 * ::res + 48 * ::res ) / 2 ) - ( ::GetFontWidth() * ( 6 / 2 ) ), ::maxHeight + 1, SubStr( ::text, 2, 6 ), ::FillColor ) + ::Say( 10 + 46 * ::res + ( 3 * ::res + 46 * ::res ) / 2 - ::GetFontWidth() * ( 6 / 2 ), ::maxHeight + 1, SubStr( ::text, 8, 6 ), ::FillColor ) ENDIF - ::lastY := ::maxHeight + ::GetFontHeight() + ::lastY := ::maxHeight + ::GetFontHeight() RETURN NIL @@ -326,7 +326,7 @@ METHOD Draw8( cText ) CLASS TCode IF !lerror - ::positionX := iif( ::textfont == 0 , 0, 10 ) + ::positionX := iif( ::textfont == 0, 0, 10 ) //xParity := ::Parity[ 7 ] @@ -340,7 +340,7 @@ METHOD Draw8( cText ) CLASS TCode FOR ii := 1 TO Len( ::text ) - IF Mod( ( (Len(::text ) + 1 ) - ii ), 2 ) == 0 + IF Mod( ( Len( ::text ) + 1 ) - ii, 2 ) == 0 nchkSum := nchkSum + Int( Val( SubStr( ::text, ii, 1 ) ) ) ELSE nchkSum := nchkSum + Int( Val( SubStr( ::text, ii, 1 ) ) ) * 3 @@ -383,7 +383,7 @@ METHOD Draw8( cText ) CLASS TCode ::lastX := ::positionX ::lastY := ::maxHeight - ctext += AllTrim( Str( nChk, 1 ) ) + ctext += Str( nChk, 1 ) // Draw text IF ::lDrawValue diff --git a/harbour/contrib/hbnf/acctmnth.prg b/harbour/contrib/hbnf/acctmnth.prg index 8d4f0ce69b..d07df5d6c1 100644 --- a/harbour/contrib/hbnf/acctmnth.prg +++ b/harbour/contrib/hbnf/acctmnth.prg @@ -80,6 +80,6 @@ FUNCTION FT_ACCTMONTH( dGivenDate, nMonthNum ) aRetVal[ 3 ] := FT_ACCTADJ( aRetVal[ 3 ], .T. ) ENDIF - aRetVal[ 1 ] := Str( nYTemp, 4 ) + PadL( LTrim( Str( nMTemp, 2 ) ), 2, "0" ) + aRetVal[ 1 ] := Str( nYTemp, 4 ) + StrZero( nMTemp, 2 ) RETURN aRetVal diff --git a/harbour/contrib/hbnf/acctqtr.prg b/harbour/contrib/hbnf/acctqtr.prg index 4997df2514..00a08293b9 100644 --- a/harbour/contrib/hbnf/acctqtr.prg +++ b/harbour/contrib/hbnf/acctqtr.prg @@ -79,6 +79,6 @@ FUNCTION FT_ACCTQTR( dGivenDate, nQtrNum ) aRetVal[ 3 ] := FT_ACCTADJ( aRetVal[ 3 ], .T. ) ENDIF - aRetVal[ 1 ] := Str( nYTemp, 4 ) + PadL( LTrim( Str( nQTemp, 2 ) ), 2, "0" ) + aRetVal[ 1 ] := Str( nYTemp, 4 ) + StrZero( nQTemp, 2 ) RETURN aRetVal diff --git a/harbour/contrib/hbnf/acctweek.prg b/harbour/contrib/hbnf/acctweek.prg index 0f7fa2782a..094171bcd4 100644 --- a/harbour/contrib/hbnf/acctweek.prg +++ b/harbour/contrib/hbnf/acctweek.prg @@ -48,8 +48,7 @@ FUNCTION FT_ACCTWEEK( dGivenDate, nWeekNum ) dGivenDate := aRetVal[ 2 ] + ( nWeekNum - 1 ) * 7 ENDIF - aRetVal[ 1 ] += PadL( LTrim( Str( Int( ( dGivenDate - ; - aRetVal[ 2 ] ) / 7 ) + 1, 2 ) ), 2, "0" ) + aRetVal[ 1 ] += StrZero( Int( ( dGivenDate - aRetVal[ 2 ] ) / 7 ) + 1, 2 ) dGivenDate += ( 6 - FT_DAYTOBOW( dGivenDate ) ) // end of week aRetVal[ 2 ] := dGivenDate - 6 aRetVal[ 3 ] := dGivenDate diff --git a/harbour/contrib/hbnf/dayofyr.prg b/harbour/contrib/hbnf/dayofyr.prg index c8cee46378..7512bf200b 100644 --- a/harbour/contrib/hbnf/dayofyr.prg +++ b/harbour/contrib/hbnf/dayofyr.prg @@ -56,7 +56,7 @@ FUNCTION FT_DAYOFYR( dGivenDate, nDayNum, lIsAcct ) ENDIF aRetVal[ 1 ] := aRetVal[ 2 ] + nDayNum - 1 ELSE - aRetVal[ 1 ] += PadL( LTrim( Str( dGivenDate - aRetVal[ 2 ] + 1, 3 ) ), 3, "0" ) + aRetVal[ 1 ] += StrZero( dGivenDate - aRetVal[ 2 ] + 1, 3 ) ENDIF RETURN aRetVal diff --git a/harbour/contrib/hbnf/month.prg b/harbour/contrib/hbnf/month.prg index ce3d910a9b..5df87570a9 100644 --- a/harbour/contrib/hbnf/month.prg +++ b/harbour/contrib/hbnf/month.prg @@ -50,7 +50,7 @@ FUNCTION FT_MONTH( dGivenDate, nMonthNum ) nTemp := Month( dGivenDate ) - Month( aRetVal[ 2 ] ) nTemp += iif( nTemp >= 0, 1, 13 ) - aRetVal[ 1 ] += PadL( LTrim( Str( nTemp, 2 ) ), 2, "0" ) + aRetVal[ 1 ] += StrZero( nTemp, 2 ) aRetVal[ 2 ] := FT_MADD( aRetVal[ 2 ], nTemp - 1 ) aRetVal[ 3 ] := FT_MADD( aRetVal[ 2 ], 1 ) - 1 diff --git a/harbour/contrib/hbnf/ntow.prg b/harbour/contrib/hbnf/ntow.prg index 68a9f7eb5f..144f77d937 100644 --- a/harbour/contrib/hbnf/ntow.prg +++ b/harbour/contrib/hbnf/ntow.prg @@ -75,8 +75,4 @@ STATIC FUNCTION grp_to_words( nGrp, sQual ) STATIC FUNCTION sol10( nNumber ) - LOCAL sTemp - - sTemp := LTrim( Str( Int( nNumber ), 0 ) ) - - RETURN Len( sTemp ) - 1 + RETURN Len( hb_ntos( Int( nNumber ) ) ) - 1 diff --git a/harbour/contrib/hbnf/qtr.prg b/harbour/contrib/hbnf/qtr.prg index f6a686caf7..f515dc5d7f 100644 --- a/harbour/contrib/hbnf/qtr.prg +++ b/harbour/contrib/hbnf/qtr.prg @@ -51,7 +51,7 @@ FUNCTION FT_QTR( dGivenDate, nQtrNum ) nTemp += iif( nTemp >= 0, 1, 13 ) nTemp := Int( ( nTemp - 1 ) / 3 ) - aRetVal[ 1 ] += PadL( LTrim( Str( nTemp + 1, 2 ) ), 2, "0" ) + aRetVal[ 1 ] += StrZero( nTemp + 1, 2 ) aRetVal[ 2 ] := FT_MADD( aRetVal[ 2 ], nTemp * 3 ) aRetVal[ 3 ] := FT_MADD( aRetVal[ 2 ], 3 ) - 1 diff --git a/harbour/contrib/hbnf/week.prg b/harbour/contrib/hbnf/week.prg index 12025b9785..3b1abf3cfe 100644 --- a/harbour/contrib/hbnf/week.prg +++ b/harbour/contrib/hbnf/week.prg @@ -52,8 +52,7 @@ FUNCTION FT_WEEK( dGivenDate, nWeekNum ) dGivenDate += ( 6 - FT_DAYTOBOW( dGivenDate ) ) // end of week - aRetVal[ 1 ] += PadL( LTrim( Str( Int( ( dGivenDate - ; - aRetVal[ 2 ] ) / 7 ) + 1, 2 ) ), 2, "0" ) + aRetVal[ 1 ] += StrZero( Int( ( dGivenDate - aRetVal[ 2 ] ) / 7 ) + 1, 2 ) aRetVal[ 2 ] := Max( dGivenDate - 6, dTemp ) aRetVal[ 3 ] := Min( dGivenDate, aRetVal[ 3 ] ) diff --git a/harbour/extras/hbxlsxml/tests/example.prg b/harbour/extras/hbxlsxml/tests/example.prg index d2b7d25834..447cdd16dd 100644 --- a/harbour/extras/hbxlsxml/tests/example.prg +++ b/harbour/extras/hbxlsxml/tests/example.prg @@ -225,7 +225,7 @@ PROCEDURE Main() Date() - 50 - i, ; "5.102", ; StrZero( i, 5 ), ; - "NOME DO CLIENTE TESTE " + AllTrim( Str( i, 5, 0 ) ), ; + "NOME DO CLIENTE TESTE " + hb_ntos( i ) ), ; "PR", ; i * 100, ; i * 100 * 0.90, ; diff --git a/harbour/extras/hbxlsxml/xlsxml.prg b/harbour/extras/hbxlsxml/xlsxml.prg index d857d7a7dd..6d49aa0eef 100644 --- a/harbour/extras/hbxlsxml/xlsxml.prg +++ b/harbour/extras/hbxlsxml/xlsxml.prg @@ -260,32 +260,32 @@ METHOD ExcelWriterXML:writeData( target ) format:bgColor( "red" ) ENDIF - IF ! Empty( ::cDocTitle ); docTitle := "" + StrToHtmlEspecial( ::cDocTitle ) + "" + hb_osNewLine(); ENDIF - IF ! Empty( ::cDocSubject ); docSubject := "" + StrToHtmlEspecial( ::cDocSubject ) + "" + hb_osNewLine(); ENDIF - IF ! Empty( ::cDocAuthor ); docAuthor := "" + StrToHtmlEspecial( ::cDocAuthor ) + "" + hb_osNewLine(); ENDIF - IF ! Empty( ::cDocCreated ); docCreated := "" + StrToHtmlEspecial( ::cDocCreated ) + "" + hb_osNewLine(); ENDIF - IF ! Empty( ::cDocManager ); docManager := "" + StrToHtmlEspecial( ::cDocManager ) + "" + hb_osNewLine(); ENDIF - IF ! Empty( ::cDocCompany ); docCompany := "" + StrToHtmlEspecial( ::cDocCompany ) + "" + hb_osNewLine(); ENDIF + IF ! Empty( ::cDocTitle ); docTitle := "" + StrToHtmlEspecial( ::cDocTitle ) + "" + hb_eol(); ENDIF + IF ! Empty( ::cDocSubject ); docSubject := "" + StrToHtmlEspecial( ::cDocSubject ) + "" + hb_eol(); ENDIF + IF ! Empty( ::cDocAuthor ); docAuthor := "" + StrToHtmlEspecial( ::cDocAuthor ) + "" + hb_eol(); ENDIF + IF ! Empty( ::cDocCreated ); docCreated := "" + StrToHtmlEspecial( ::cDocCreated ) + "" + hb_eol(); ENDIF + IF ! Empty( ::cDocManager ); docManager := "" + StrToHtmlEspecial( ::cDocManager ) + "" + hb_eol(); ENDIF + IF ! Empty( ::cDocCompany ); docCompany := "" + StrToHtmlEspecial( ::cDocCompany ) + "" + hb_eol(); ENDIF - xml := '' + hb_osNewLine() - xml += '' + hb_osNewLine() - xml += "" + hb_osNewLine() - xml += "" + hb_osNewLine() - xml += '' + hb_osNewLine() - xml += "" + hb_osNewLine() + xml += " " + ::cDocVersion + "" + hb_eol() + xml += "" + hb_eol() + xml += '' + hb_eol() + xml += "" + hb_eol() FWrite( handle, xml ) xml := "" @@ -293,7 +293,7 @@ METHOD ExcelWriterXML:writeData( target ) FOR EACH style IN ::styles xml += style:getStyleXML() NEXT - xml += "" + hb_osNewLine() + xml += "" + hb_eol() FWrite( handle, xml ) xml := "" diff --git a/harbour/extras/hbxlsxml/xlsxml_s.prg b/harbour/extras/hbxlsxml/xlsxml_s.prg index 310d4d2b0f..c8df49c52f 100644 --- a/harbour/extras/hbxlsxml/xlsxml_s.prg +++ b/harbour/extras/hbxlsxml/xlsxml_s.prg @@ -191,8 +191,8 @@ METHOD ExcelWriterXML_Sheet:getSheetXML( handle ) displayRightToLeft := iif( ::ldisplayRightToLeft, 'ss:RightToLeft="1"', "" ) - xml := '" + hb_osNewLine() - xml += " " + hb_osNewLine() + xml := '" + hb_eol() + xml += "
" + hb_eol() FWrite( handle, xml ) xml := "" @@ -203,7 +203,7 @@ METHOD ExcelWriterXML_Sheet:getSheetXML( handle ) colWidth := hb_HValueAt( ::colWidth, ic ) colIndex := AllTrim( Str( colIndex, 10 ) ) colWidth := AllTrim( Str( colWidth, 10 ) ) - xml += ' ' + hb_osNewLine() + xml += ' ' + hb_eol() NEXT ENDIF @@ -221,7 +221,7 @@ METHOD ExcelWriterXML_Sheet:getSheetXML( handle ) rowHeight := "" ENDIF - xml += ' " + hb_osNewLine() + xml += ' " + hb_eol() FOR ic := 1 TO Len( rowData ) column := hb_HKeyAt( rowData, ic ) cell := hb_HValueAt( rowData, ic ) @@ -245,34 +245,34 @@ METHOD ExcelWriterXML_Sheet:getSheetXML( handle ) comment := "" IF hb_HPos( ::comments, row ) > 0 IF hb_HPos( ::comments[ row ], column ) > 0 - comment := ' ' + hb_osNewLine() - comment += ' ' + hb_osNewLine() - comment += ' ' + ::comments[ row ][ column ][ "author" ] + ":" + hb_osNewLine() - comment += ' ' + ::comments[ row ][ column ][ "comment" ] + "" + hb_osNewLine() - comment += " " + hb_osNewLine() - comment += " " + hb_osNewLine() + comment := ' ' + hb_eol() + comment += ' ' + hb_eol() + comment += ' ' + ::comments[ row ][ column ][ "author" ] + ":" + hb_eol() + comment += ' ' + ::comments[ row ][ column ][ "comment" ] + "" + hb_eol() + comment += " " + hb_eol() + comment += " " + hb_eol() ENDIF ENDIF comment := "" type := cell[ "type" ] xData := cell[ "data" ] - xml += " " + hb_osNewLine() + xml += " " + hb_eol() xml += ' ' xml += StrToHtmlEspecial( xData ) - xml += "" + hb_osNewLine() + xml += "" + hb_eol() xml += comment - xml += " " + hb_osNewLine() + xml += " " + hb_eol() NEXT - xml += " " + hb_osNewLine() + xml += " " + hb_eol() FWrite( handle, xml ) xml := "" NEXT ENDIF - xml += "
" + hb_osNewLine() - xml += "
" + hb_osNewLine() + xml += " " + hb_eol() + xml += "" + hb_eol() FWrite( handle, xml ) xml := "" diff --git a/harbour/extras/hbxlsxml/xlsxml_y.prg b/harbour/extras/hbxlsxml/xlsxml_y.prg index cf3387aaa5..632d5409b1 100644 --- a/harbour/extras/hbxlsxml/xlsxml_y.prg +++ b/harbour/extras/hbxlsxml/xlsxml_y.prg @@ -230,7 +230,7 @@ METHOD ExcelWriterXML_Style:getStyleXML() ENDIF IF ::useBorder - borders := " " + hb_osNewLine() + borders := " " + hb_eol() positions := { ; "Top" => ::borderTop, ; "Bottom" => ::borderBottom, ; @@ -254,9 +254,9 @@ METHOD ExcelWriterXML_Style:getStyleXML() bWeight := iif( hb_HPos( pData, "Weight" ) > 0, ; 'ss:Weight="' + Str( pData[ "Weight" ], 1 ) + '"', ; "" ) - borders += '" + hb_osNewLine() + borders += '" + hb_eol() NEXT - borders += "" + hb_osNewLine() + borders += "" + hb_eol() ENDIF IF ::useInterior @@ -269,31 +269,31 @@ METHOD ExcelWriterXML_Style:getStyleXML() IF ! Empty( ::interiorPatternColor ) interiorPatternColor := 'ss:PatternColor="' + ::interiorPatternColor + '"' ENDIF - interior := " " + hb_osNewLine() + interior := " " + hb_eol() ENDIF IF ! Empty( ::numberFormat ) - numberFormat := ' ' + hb_osNewLine() + numberFormat := ' ' + hb_eol() ELSE - numberFormat := " " + hb_osNewLine() + numberFormat := " " + hb_eol() ENDIF - xml := ' " + hb_osNewLine() + xml += " " + hb_eol() + xml += " " + hb_eol() RETURN xml diff --git a/harbour/tests/ac_test.prg b/harbour/tests/ac_test.prg index fd5bbb724a..4cfe94479a 100644 --- a/harbour/tests/ac_test.prg +++ b/harbour/tests/ac_test.prg @@ -20,6 +20,10 @@ #include "achoice.ch" #include "inkey.ch" +#ifndef __HARBOUR__ +#define hb_ntos( n ) LTrim( Str( n ) ) +#endif + //+-------------------------------------------------------------------- //+ //+ Procedure test() @@ -211,7 +215,7 @@ FUNCTION cUserFunction( nMode, nCurElement, nRowPos ) DO CASE // After all pending keys are processed, display message CASE nMode == AC_IDLE - @ 0, 0 SAY PadR( LTrim( Str( nCurElement ) ), 10 ) + @ 0, 0 SAY PadR( hb_ntos( nCurElement ), 10 ) nRetVal := AC_CONT // Continue ACHOICE() CASE nMode == AC_HITTOP // Attempt to go past Top @ 0, 0 SAY "Hit Top " diff --git a/harbour/tests/aliaslck.prg b/harbour/tests/aliaslck.prg index c100d78432..e3611692b0 100644 --- a/harbour/tests/aliaslck.prg +++ b/harbour/tests/aliaslck.prg @@ -103,13 +103,13 @@ proc main() return proc setLock( n ) - ? "locking record: " + ltrim( str( n ) ) + " ->", dbRLock( n ) + ? "locking record: " + hb_ntos( n ) + " ->", dbRLock( n ) return proc dspLock() local n ? alias(), "active locks:" for each n in dbRLockList() - ?? "", ltrim( str( n ) ) + ?? "", hb_ntos( n ) next return diff --git a/harbour/tests/gtstdtst.prg b/harbour/tests/gtstdtst.prg index 77fe370e70..44b175b080 100644 --- a/harbour/tests/gtstdtst.prg +++ b/harbour/tests/gtstdtst.prg @@ -4,6 +4,10 @@ /* gtstd test */ +#ifndef __HARBOUR__ +#define hb_ntos( n ) LTrim( Str( n ) ) +#endif + PROCEDURE Main() LOCAL n @@ -14,13 +18,13 @@ PROCEDURE Main() ? "Press a key to continue: " ?? Inkey( 0 ) - ? "This is row " + AllTrim( Str( Row() ) ) + ? "This is row " + hb_ntos( Row() ) - @ 7, 30 SAY "@ 7,30" - @ 7, 10 SAY "@ 7,10" - @ 7, 60 SAY "@ 7,60" + @ 7, 30 SAY "@ 7, 30" + @ 7, 10 SAY "@ 7, 10" + @ 7, 60 SAY "@ 7, 60" @ 7, 75 SAY "9876543210" - @ 6, 10 SAY "@ 6,10.." + @ 6, 10 SAY "@ 6, 10.." PosNow() ? @@ -38,7 +42,7 @@ PROCEDURE Main() PosNow() ? - ? "Press key to test for n := 100 to 120 ; tone(n, 1) ; next" + ? "Press key to test FOR n := 100 to 120; Tone( n, 1 ); NEXT" Inkey( 0 ) FOR n := 100 TO 120 Tone( n, 1 ) @@ -50,7 +54,7 @@ PROCEDURE Main() FOR n := 1 TO 25 ? "This line is on row " - ?? AllTrim( Str( Row() ) ) + ?? hb_ntos( Row() ) Inkey( 0 ) NEXT @@ -58,6 +62,6 @@ PROCEDURE Main() FUNCTION PosNow() - ?? "[" + AllTrim( Str( Row() ) ) + "," + AllTrim( Str( Col() ) ) + "]" + ?? "[" + hb_ntos( Row() ) + "," + hb_ntos( Col() ) + "]" RETURN NIL diff --git a/harbour/tests/rto_get.prg b/harbour/tests/rto_get.prg index 95a3d87fd0..ce39fbf52b 100644 --- a/harbour/tests/rto_get.prg +++ b/harbour/tests/rto_get.prg @@ -57,7 +57,8 @@ #include "inkey.ch" #ifndef __HARBOUR__ - #xtranslate hb_eol() => ( Chr( 13 ) + Chr( 10 ) ) + #define hb_eol() ( Chr( 13 ) + Chr( 10 ) ) + #define hb_ntos( n ) LTrim( Str( n ) ) #endif #translate TEST_LINE( ) => TEST_CALL( o, #, {|| } ) @@ -1484,7 +1485,7 @@ FUNCTION CallStack() LOCAL cString := "" DO WHILE !Empty( ProcName( tmp ) ) - cString += ProcName( tmp ) + " (" + LTrim( Str( ProcLine( tmp ) ) ) + ") " + cString += ProcName( tmp ) + " (" + hb_ntos( ProcLine( tmp ) ) + ") " tmp++ ENDDO @@ -1499,7 +1500,7 @@ PROCEDURE LogMe( nPCount, data, desc ) IF Empty( ProcName( nLevel ) ) EXIT ENDIF - cStack += ProcName( nLevel ) + " (" + LTrim( Str( ProcLine( nLevel ) ) ) + ") " + cStack += ProcName( nLevel ) + " (" + hb_ntos( ProcLine( nLevel ) ) + ") " NEXT IF desc == NIL @@ -1530,7 +1531,7 @@ PROCEDURE LogGETVars( o, desc, xResult ) IF Empty( ProcName( nLevel ) ) EXIT ENDIF - cStack += ProcName( nLevel ) + " (" + LTrim( Str( ProcLine( nLevel ) ) ) + ") " + cStack += ProcName( nLevel ) + " (" + hb_ntos( ProcLine( nLevel ) ) + ") " NEXT IF desc == NIL @@ -1608,7 +1609,7 @@ FUNCTION XToStr( xValue ) RETURN '"' + xValue + '"' - CASE cType == "N" ; RETURN LTrim( Str( xValue ) ) + CASE cType == "N" ; RETURN hb_ntos( xValue ) CASE cType == "D" ; RETURN 'HB_SToD("' + DToS( xValue ) + '")' CASE cType == "L" ; RETURN iif( xValue, ".T.", ".F." ) CASE cType == "O" ; RETURN xValue:className() + " Object" @@ -1647,7 +1648,7 @@ FUNCTION XToStrE( xValue ) RETURN xValue - CASE cType == "N" ; RETURN LTrim( Str( xValue ) ) + CASE cType == "N" ; RETURN hb_ntos( xValue ) CASE cType == "D" ; RETURN DToS( xValue ) CASE cType == "L" ; RETURN iif( xValue, ".T.", ".F." ) CASE cType == "O" ; RETURN xValue:className() + " Object" @@ -1676,7 +1677,7 @@ FUNCTION XToStrX( xValue ) RETURN xValue - CASE cType == "N" ; RETURN LTrim( Str( xValue ) ) + CASE cType == "N" ; RETURN hb_ntos( xValue ) CASE cType == "D" ; RETURN DToS( xValue ) CASE cType == "L" ; RETURN iif( xValue, ".T.", ".F." ) CASE cType == "O" ; RETURN xValue:className() + " Object" @@ -1720,7 +1721,7 @@ STATIC FUNCTION ErrorMessage( oError ) cMessage += oError:subsystem + " " ENDIF IF ValType( oError:subCode ) == "N" - cMessage += LTrim( Str( oError:subCode ) ) + " " + cMessage += hb_ntos( oError:subCode ) + " " ENDIF IF ValType( oError:description ) == "C" cMessage += oError:description + " " @@ -1733,7 +1734,7 @@ STATIC FUNCTION ErrorMessage( oError ) ENDIF IF ValType( oError:Args ) == "A" - cMessage += "A:" + LTrim( Str( Len( oError:Args ) ) ) + ":" + cMessage += "A:" + hb_ntos( Len( oError:Args ) ) + ":" FOR tmp := 1 TO Len( oError:Args ) cMessage += ValType( oError:Args[ tmp ] ) + ":" + XToStrE( oError:Args[ tmp ] ) IF tmp < Len( oError:Args ) diff --git a/harbour/tests/rto_tb.prg b/harbour/tests/rto_tb.prg index 5e4c3f8750..6a555d8728 100644 --- a/harbour/tests/rto_tb.prg +++ b/harbour/tests/rto_tb.prg @@ -67,7 +67,8 @@ #include "fileio.ch" #ifndef __HARBOUR__ - #xtranslate hb_eol() => ( Chr( 13 ) + Chr( 10 ) ) + #define hb_eol() ( Chr( 13 ) + Chr( 10 ) ) + #define hb_ntos( n ) LTrim( Str( n ) ) #endif #ifdef __XHARBOUR__ @@ -416,7 +417,7 @@ PROCEDURE LogMe( data, desc ) IF Empty( ProcName( nLevel ) ) EXIT ENDIF - cStack += ProcName( nLevel ) + " (" + LTrim( Str( ProcLine( nLevel ) ) ) + ") " + cStack += ProcName( nLevel ) + " (" + hb_ntos( ProcLine( nLevel ) ) + ") " NEXT IF desc == NIL @@ -448,7 +449,7 @@ PROCEDURE LogTBRVars( o, desc, xResult ) IF Empty( ProcName( nLevel ) ) EXIT ENDIF - cStack += ProcName( nLevel ) + " (" + LTrim( Str( ProcLine( nLevel ) ) ) + ") " + cStack += ProcName( nLevel ) + " (" + hb_ntos( ProcLine( nLevel ) ) + ") " NEXT IF desc == NIL @@ -543,7 +544,7 @@ PROCEDURE LogTBCVars( o, desc, xResult ) IF Empty( ProcName( nLevel ) ) EXIT ENDIF - cStack += ProcName( nLevel ) + " (" + LTrim( Str( ProcLine( nLevel ) ) ) + ") " + cStack += ProcName( nLevel ) + " (" + hb_ntos( ProcLine( nLevel ) ) + ") " NEXT IF desc == NIL @@ -605,7 +606,7 @@ FUNCTION XToStr( xValue ) RETURN '"' + xValue + '"' - CASE cType == "N" ; RETURN LTrim( Str( xValue ) ) + CASE cType == "N" ; RETURN hb_ntos( xValue ) CASE cType == "D" ; RETURN 'HB_SToD("' + DToS( xValue ) + '")' CASE cType == "L" ; RETURN iif( xValue, ".T.", ".F." ) CASE cType == "O" ; RETURN xValue:className() + " Object" @@ -644,7 +645,7 @@ FUNCTION XToStrE( xValue ) RETURN xValue - CASE cType == "N" ; RETURN LTrim( Str( xValue ) ) + CASE cType == "N" ; RETURN hb_ntos( xValue ) CASE cType == "D" ; RETURN DToS( xValue ) CASE cType == "L" ; RETURN iif( xValue, ".T.", ".F." ) CASE cType == "O" ; RETURN xValue:className() + " Object" @@ -673,7 +674,7 @@ FUNCTION XToStrX( xValue ) RETURN xValue - CASE cType == "N" ; RETURN LTrim( Str( xValue ) ) + CASE cType == "N" ; RETURN hb_ntos( xValue ) CASE cType == "D" ; RETURN DToS( xValue ) CASE cType == "L" ; RETURN iif( xValue, ".T.", ".F." ) CASE cType == "O" ; RETURN xValue:className() + " Object" @@ -730,7 +731,7 @@ STATIC FUNCTION ErrorMessage( oError ) cMessage += oError:subsystem + " " ENDIF IF ValType( oError:subCode ) == "N" - cMessage += LTrim( Str( oError:subCode ) ) + " " + cMessage += hb_ntos( oError:subCode ) + " " ENDIF IF ValType( oError:description ) == "C" cMessage += oError:description + " " @@ -744,7 +745,7 @@ STATIC FUNCTION ErrorMessage( oError ) ENDIF IF ValType( oError:Args ) == "A" - cMessage += "A:" + LTrim( Str( Len( oError:Args ) ) ) + ":" + cMessage += "A:" + hb_ntos( Len( oError:Args ) ) + ":" FOR tmp := 1 TO Len( oError:Args ) cMessage += ValType( oError:Args[ tmp ] ) + ":" + XToStrE( oError:Args[ tmp ] ) IF tmp < Len( oError:Args ) diff --git a/harbour/tests/teststr.prg b/harbour/tests/teststr.prg index dcd2b5e7fa..894b5fb7fb 100644 --- a/harbour/tests/teststr.prg +++ b/harbour/tests/teststr.prg @@ -69,7 +69,7 @@ PROCEDURE test() FOR nI := 1 TO 20 ? - ?? LTrim( Str( 6 + nI ) ) + ": " + ?? Str( 6 + nI ) + ": " ?? 10 ** nI + ( 1.02 * 1.02 ) NEXT ? diff --git a/harbour/website/samples/dates3.prg.html b/harbour/website/samples/dates3.prg.html index 9d87fde309..c1ae3ff2fb 100644 --- a/harbour/website/samples/dates3.prg.html +++ b/harbour/website/samples/dates3.prg.html @@ -28,7 +28,7 @@ body { color: #000000; background-color: #FFFFFF; } function main() - LOCAL dDate, i, cNewLine := HB_OSNewLine() + LOCAL dDate, i, cNewLine := hb_eol() set( _SET_DATEFORMAT, "dd/mm/yyyy" ) dDate := cToD( "25/05/1999" ) diff --git a/harbour/website/samples/dates4.prg.html b/harbour/website/samples/dates4.prg.html index 9c15d9865f..3ae63542bb 100644 --- a/harbour/website/samples/dates4.prg.html +++ b/harbour/website/samples/dates4.prg.html @@ -31,7 +31,7 @@ body { color: #000000; background-color: #FFFFFF; } LOCAL i LOCAL dDate := date() - s_cNewLine := HB_OSNewLine() + s_cNewLine := hb_eol() set( _SET_DATEFORMAT, "dd/mm/yyyy" ) diff --git a/harbour/website/samples/testcgi.prg.html b/harbour/website/samples/testcgi.prg.html index 23dba79484..94b0ad8eca 100644 --- a/harbour/website/samples/testcgi.prg.html +++ b/harbour/website/samples/testcgi.prg.html @@ -282,8 +282,8 @@ body { color: #000000; background-color: #FFFFFF; } LOCAL Self := QSelf() ::cBody := ::cBody + ; - "<P ALIGN='" + cAlign + "'>" + HB_OSNewLine() + ; - cPara + HB_OSNewLine() + ; + "<P ALIGN='" + cAlign + "'>" + hb_eol() + ; + cPara + hb_eol() + ; "</P>" RETURN( Self ) @@ -297,11 +297,11 @@ body { color: #000000; background-color: #FFFFFF; } // Is this a meta file or hand generated script? IF empty( ::cHTMLFile ) ::cContent := ; - "<HTML><HEAD>" + HB_OSNewLine() + ; - "<TITLE>" + ::cTitle + "</TITLE>" + HB_OSNewLine() + ; + "<HTML><HEAD>" + hb_eol() + ; + "<TITLE>" + ::cTitle + "</TITLE>" + hb_eol() + ; "<BODY link='" + ::cLinkColor + "' " + ; - "vlink='" + ::cvLinkColor + "'>" + + HB_OSNewLine() + ; - ::cBody + HB_OSNewLine() + ; + "vlink='" + ::cvLinkColor + "'>" + + hb_eol() + ; + ::cBody + hb_eol() + ; "</BODY></HTML>" ELSE ::cContent := "" @@ -361,8 +361,8 @@ body { color: #000000; background-color: #FFFFFF; } LOCAL Self := QSelf() OutStd( ; - "HTTP/1.0 200 OK" + HB_OSNewLine() + ; - "CONTENT-TYPE: TEXT/HTML" + HB_OSNewLine() + HB_OSNewLine() + ; + "HTTP/1.0 200 OK" + hb_eol() + ; + "CONTENT-TYPE: TEXT/HTML" + hb_eol() + hb_eol() + ; ::cContent ) RETURN( Self ) diff --git a/harbour/website/samples/testhtml.prg.html b/harbour/website/samples/testhtml.prg.html index 7027e6c3ee..e062ce4385 100644 --- a/harbour/website/samples/testhtml.prg.html +++ b/harbour/website/samples/testhtml.prg.html @@ -41,7 +41,7 @@ body { color: #000000; background-color: #FFFFFF; } LOCAL oHTML := THTML():New() - s_cNewLine := HB_OSNewLine() + s_cNewLine := hb_eol() oHTML:SetTitle( "Harbour Power Demonstration" ) oHTML:AddHead( "Harbour Project" )