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()
This commit is contained in:
Viktor Szakats
2012-10-12 09:27:09 +00:00
parent fc3d5a24a7
commit 06fe543d39
25 changed files with 161 additions and 114 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 ] )

View File

@@ -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, ;

View File

@@ -260,32 +260,32 @@ METHOD ExcelWriterXML:writeData( target )
format:bgColor( "red" )
ENDIF
IF ! Empty( ::cDocTitle ); docTitle := "<Title>" + StrToHtmlEspecial( ::cDocTitle ) + "</Title>" + hb_osNewLine(); ENDIF
IF ! Empty( ::cDocSubject ); docSubject := "<Subject>" + StrToHtmlEspecial( ::cDocSubject ) + "</Subject>" + hb_osNewLine(); ENDIF
IF ! Empty( ::cDocAuthor ); docAuthor := "<Author>" + StrToHtmlEspecial( ::cDocAuthor ) + "</Author>" + hb_osNewLine(); ENDIF
IF ! Empty( ::cDocCreated ); docCreated := "<Created>" + StrToHtmlEspecial( ::cDocCreated ) + "</Created>" + hb_osNewLine(); ENDIF
IF ! Empty( ::cDocManager ); docManager := "<Manager>" + StrToHtmlEspecial( ::cDocManager ) + "</Manager>" + hb_osNewLine(); ENDIF
IF ! Empty( ::cDocCompany ); docCompany := "<Company>" + StrToHtmlEspecial( ::cDocCompany ) + "</Company>" + hb_osNewLine(); ENDIF
IF ! Empty( ::cDocTitle ); docTitle := "<Title>" + StrToHtmlEspecial( ::cDocTitle ) + "</Title>" + hb_eol(); ENDIF
IF ! Empty( ::cDocSubject ); docSubject := "<Subject>" + StrToHtmlEspecial( ::cDocSubject ) + "</Subject>" + hb_eol(); ENDIF
IF ! Empty( ::cDocAuthor ); docAuthor := "<Author>" + StrToHtmlEspecial( ::cDocAuthor ) + "</Author>" + hb_eol(); ENDIF
IF ! Empty( ::cDocCreated ); docCreated := "<Created>" + StrToHtmlEspecial( ::cDocCreated ) + "</Created>" + hb_eol(); ENDIF
IF ! Empty( ::cDocManager ); docManager := "<Manager>" + StrToHtmlEspecial( ::cDocManager ) + "</Manager>" + hb_eol(); ENDIF
IF ! Empty( ::cDocCompany ); docCompany := "<Company>" + StrToHtmlEspecial( ::cDocCompany ) + "</Company>" + hb_eol(); ENDIF
xml := '<?xml version="1.0"?>' + hb_osNewLine()
xml += '<?mso-application progid="Excel.Sheet"?>' + hb_osNewLine()
xml += "<Workbook" + hb_osNewLine()
xml += 'xmlns="urn:schemas-microsoft-com:office:spreadsheet"' + hb_osNewLine()
xml += 'xmlns:o="urn:schemas-microsoft-com:office:office"' + hb_osNewLine()
xml += 'xmlns:x="urn:schemas-microsoft-com:office:excel"' + hb_osNewLine()
xml += 'xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"' + hb_osNewLine()
xml += 'xmlns:html="http://www.w3.org/TR/REC-html40">' + hb_osNewLine()
xml += '<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">' + hb_osNewLine()
xml := '<?xml version="1.0"?>' + hb_eol()
xml += '<?mso-application progid="Excel.Sheet"?>' + hb_eol()
xml += "<Workbook" + hb_eol()
xml += 'xmlns="urn:schemas-microsoft-com:office:spreadsheet"' + hb_eol()
xml += 'xmlns:o="urn:schemas-microsoft-com:office:office"' + hb_eol()
xml += 'xmlns:x="urn:schemas-microsoft-com:office:excel"' + hb_eol()
xml += 'xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"' + hb_eol()
xml += 'xmlns:html="http://www.w3.org/TR/REC-html40">' + hb_eol()
xml += '<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">' + hb_eol()
IF ! Empty( ::cDocTitle ); xml += " " + docTitle ; ENDIF
IF ! Empty( ::cDocSubject ); xml += " " + docSubject; ENDIF
IF ! Empty( ::cDocAuthor ); xml += " " + docAuthor ; ENDIF
IF ! Empty( ::cDocCreated ); xml += " " + docCreated; ENDIF
IF ! Empty( ::cDocManager ); xml += " " + docManager; ENDIF
IF ! Empty( ::cDocCompany ); xml += " " + docCompany; ENDIF
xml += " <Version>" + ::cDocVersion + "</Version>" + hb_osNewLine()
xml += "</DocumentProperties>" + hb_osNewLine()
xml += '<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel" />' + hb_osNewLine()
xml += "<Styles>" + hb_osNewLine()
xml += " <Version>" + ::cDocVersion + "</Version>" + hb_eol()
xml += "</DocumentProperties>" + hb_eol()
xml += '<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel" />' + hb_eol()
xml += "<Styles>" + hb_eol()
FWrite( handle, xml )
xml := ""
@@ -293,7 +293,7 @@ METHOD ExcelWriterXML:writeData( target )
FOR EACH style IN ::styles
xml += style:getStyleXML()
NEXT
xml += "</Styles>" + hb_osNewLine()
xml += "</Styles>" + hb_eol()
FWrite( handle, xml )
xml := ""

View File

@@ -191,8 +191,8 @@ METHOD ExcelWriterXML_Sheet:getSheetXML( handle )
displayRightToLeft := iif( ::ldisplayRightToLeft, 'ss:RightToLeft="1"', "" )
xml := '<Worksheet ss:Name="' + ::id + '" ' + displayRightToLeft + ">" + hb_osNewLine()
xml += " <Table>" + hb_osNewLine()
xml := '<Worksheet ss:Name="' + ::id + '" ' + displayRightToLeft + ">" + hb_eol()
xml += " <Table>" + 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 += ' <Column ss:Index="' + colIndex + '" ss:AutoFitWidth="0" ss:Width="' + colWidth + '"/>' + hb_osNewLine()
xml += ' <Column ss:Index="' + colIndex + '" ss:AutoFitWidth="0" ss:Width="' + colWidth + '"/>' + hb_eol()
NEXT
ENDIF
@@ -221,7 +221,7 @@ METHOD ExcelWriterXML_Sheet:getSheetXML( handle )
rowHeight := ""
ENDIF
xml += ' <Row ss:Index="' + AllTrim( Str( row, 10 ) ) + '" ' + rowHeight + " >" + hb_osNewLine()
xml += ' <Row ss:Index="' + AllTrim( Str( row, 10 ) ) + '" ' + rowHeight + " >" + 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 := ' <Comment ss:Author="' + ::comments[ row ][ column ][ "author" ] + '">' + hb_osNewLine()
comment += ' <ss:Data xmlns="http://www.w3.org/TR/REC-html40">' + hb_osNewLine()
comment += ' <B><Font html:Face="Tahoma" x:CharSet="1" html:Size="8" html:Color="#000000">' + ::comments[ row ][ column ][ "author" ] + ":</Font></B>" + hb_osNewLine()
comment += ' <Font html:Face="Tahoma" x:CharSet="1" html:Size="8" html:Color="#000000">' + ::comments[ row ][ column ][ "comment" ] + "</Font>" + hb_osNewLine()
comment += " </ss:Data>" + hb_osNewLine()
comment += " </Comment>" + hb_osNewLine()
comment := ' <Comment ss:Author="' + ::comments[ row ][ column ][ "author" ] + '">' + hb_eol()
comment += ' <ss:Data xmlns="http://www.w3.org/TR/REC-html40">' + hb_eol()
comment += ' <B><Font html:Face="Tahoma" x:CharSet="1" html:Size="8" html:Color="#000000">' + ::comments[ row ][ column ][ "author" ] + ":</Font></B>" + hb_eol()
comment += ' <Font html:Face="Tahoma" x:CharSet="1" html:Size="8" html:Color="#000000">' + ::comments[ row ][ column ][ "comment" ] + "</Font>" + hb_eol()
comment += " </ss:Data>" + hb_eol()
comment += " </Comment>" + hb_eol()
ENDIF
ENDIF
comment := ""
type := cell[ "type" ]
xData := cell[ "data" ]
xml += " <Cell " + style + ' ss:Index="' + AllTrim( Str( column, 10 ) ) + '" ' + URL + " " + mergeCell + " " + formula + ">" + hb_osNewLine()
xml += " <Cell " + style + ' ss:Index="' + AllTrim( Str( column, 10 ) ) + '" ' + URL + " " + mergeCell + " " + formula + ">" + hb_eol()
xml += ' <Data ss:Type="' + type + '">'
xml += StrToHtmlEspecial( xData )
xml += "</Data>" + hb_osNewLine()
xml += "</Data>" + hb_eol()
xml += comment
xml += " </Cell>" + hb_osNewLine()
xml += " </Cell>" + hb_eol()
NEXT
xml += " </Row>" + hb_osNewLine()
xml += " </Row>" + hb_eol()
FWrite( handle, xml )
xml := ""
NEXT
ENDIF
xml += " </Table>" + hb_osNewLine()
xml += "</Worksheet>" + hb_osNewLine()
xml += " </Table>" + hb_eol()
xml += "</Worksheet>" + hb_eol()
FWrite( handle, xml )
xml := ""

View File

@@ -230,7 +230,7 @@ METHOD ExcelWriterXML_Style:getStyleXML()
ENDIF
IF ::useBorder
borders := " <Borders>" + hb_osNewLine()
borders := " <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 += '<Border ss:Position="' + position + '" ' + bLinestyle + " " + bColor + " " + bWeight + "/>" + hb_osNewLine()
borders += '<Border ss:Position="' + position + '" ' + bLinestyle + " " + bColor + " " + bWeight + "/>" + hb_eol()
NEXT
borders += "</Borders>" + hb_osNewLine()
borders += "</Borders>" + hb_eol()
ENDIF
IF ::useInterior
@@ -269,31 +269,31 @@ METHOD ExcelWriterXML_Style:getStyleXML()
IF ! Empty( ::interiorPatternColor )
interiorPatternColor := 'ss:PatternColor="' + ::interiorPatternColor + '"'
ENDIF
interior := " <Interior " + interiorColor + " " + interiorPattern + " " + interiorPatternColor + "/>" + hb_osNewLine()
interior := " <Interior " + interiorColor + " " + interiorPattern + " " + interiorPatternColor + "/>" + hb_eol()
ENDIF
IF ! Empty( ::numberFormat )
numberFormat := ' <NumberFormat ss:Format="' + ::numberFormat + '"/>' + hb_osNewLine()
numberFormat := ' <NumberFormat ss:Format="' + ::numberFormat + '"/>' + hb_eol()
ELSE
numberFormat := " <NumberFormat/>" + hb_osNewLine()
numberFormat := " <NumberFormat/>" + hb_eol()
ENDIF
xml := ' <Style ss:ID="' + ::id + '" ' + name + ">" + hb_osNewLine()
xml := ' <Style ss:ID="' + ::id + '" ' + name + ">" + hb_eol()
IF ::useAlignment
xml += " <Alignment " + valign + " " + halign + " " + rotate + " " + shrinktofit + " " + wraptext + " " + verticaltext + "/>" + hb_osNewLine()
xml += " <Alignment " + valign + " " + halign + " " + rotate + " " + shrinktofit + " " + wraptext + " " + verticaltext + "/>" + hb_eol()
ENDIF
IF ::useBorder
xml += borders
ENDIF
IF ::useFont
xml += " <Font " + fontSize + " " + fontColor + " " + bold + " " + italic + " " + strikethrough + " " + underline + " " + shadow + " " + outline + " " + fontName + " " + fontFamily + "/>" + hb_osNewLine()
xml += " <Font " + fontSize + " " + fontColor + " " + bold + " " + italic + " " + strikethrough + " " + underline + " " + shadow + " " + outline + " " + fontName + " " + fontFamily + "/>" + hb_eol()
ENDIF
IF ::useInterior
xml += interior
ENDIF
xml += numberFormat
xml += " <Protection/>" + hb_osNewLine()
xml += " </Style>" + hb_osNewLine()
xml += " <Protection/>" + hb_eol()
xml += " </Style>" + hb_eol()
RETURN xml

View File

@@ -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 "

View File

@@ -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

View File

@@ -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

View File

@@ -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( <x> ) => TEST_CALL( o, #<x>, {|| <x> } )
@@ -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 )

View File

@@ -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 )

View File

@@ -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
?

View File

@@ -28,7 +28,7 @@ body { color: #000000; background-color: #FFFFFF; }
</SPAN><SPAN class=any1-reservedword>function</SPAN><SPAN class=any1-space> </SPAN><SPAN class=any1-variable>main</SPAN><SPAN class=any1-symbol>()
</SPAN><SPAN class=any1-reservedword>LOCAL</SPAN><SPAN class=any1-space> dDate, i, cNewLine := </SPAN><SPAN class=any1-variable>HB_OSNewLine</SPAN><SPAN class=any1-symbol>()
</SPAN><SPAN class=any1-reservedword>LOCAL</SPAN><SPAN class=any1-space> dDate, i, cNewLine := </SPAN><SPAN class=any1-variable>hb_eol</SPAN><SPAN class=any1-symbol>()
</SPAN><SPAN class=any1-function>set</SPAN><SPAN class=any1-symbol>( _SET_DATEFORMAT, </SPAN><SPAN class=any1-string>"dd/mm/yyyy"</SPAN><SPAN class=any1-space> )
dDate := </SPAN><SPAN class=any1-function>cToD</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>"25/05/1999"</SPAN><SPAN class=any1-space> )

View File

@@ -31,7 +31,7 @@ body { color: #000000; background-color: #FFFFFF; }
</SPAN><SPAN class=any1-reservedword>LOCAL</SPAN><SPAN class=any1-space> i
</SPAN><SPAN class=any1-reservedword>LOCAL</SPAN><SPAN class=any1-space> dDate := </SPAN><SPAN class=any1-function>date</SPAN><SPAN class=any1-symbol>()
s_cNewLine := </SPAN><SPAN class=any1-variable>HB_OSNewLine</SPAN><SPAN class=any1-symbol>()
s_cNewLine := </SPAN><SPAN class=any1-variable>hb_eol</SPAN><SPAN class=any1-symbol>()
</SPAN><SPAN class=any1-function>set</SPAN><SPAN class=any1-symbol>( _SET_DATEFORMAT, </SPAN><SPAN class=any1-string>"dd/mm/yyyy"</SPAN><SPAN class=any1-space> )

View File

@@ -282,8 +282,8 @@ body { color: #000000; background-color: #FFFFFF; }
</SPAN><SPAN class=any1-reservedword>LOCAL</SPAN><SPAN class=any1-space> Self := </SPAN><SPAN class=any1-variable>QSelf</SPAN><SPAN class=any1-symbol>()
::cBody := ::cBody + ;
</SPAN><SPAN class=any1-string>"&lt;P ALIGN='"</SPAN><SPAN class=any1-space> + cAlign + </SPAN><SPAN class=any1-string>"'&gt;"</SPAN><SPAN class=any1-space> + </SPAN><SPAN class=any1-variable>HB_OSNewLine</SPAN><SPAN class=any1-symbol>() + ;
cPara + </SPAN><SPAN class=any1-variable>HB_OSNewLine</SPAN><SPAN class=any1-symbol>() + ;
</SPAN><SPAN class=any1-string>"&lt;P ALIGN='"</SPAN><SPAN class=any1-space> + cAlign + </SPAN><SPAN class=any1-string>"'&gt;"</SPAN><SPAN class=any1-space> + </SPAN><SPAN class=any1-variable>hb_eol</SPAN><SPAN class=any1-symbol>() + ;
cPara + </SPAN><SPAN class=any1-variable>hb_eol</SPAN><SPAN class=any1-symbol>() + ;
</SPAN><SPAN class=any1-string>"&lt;/P&gt;"
</SPAN><SPAN class=any1-space> </SPAN><SPAN class=any1-reservedword>RETURN</SPAN><SPAN class=any1-symbol>( Self )
@@ -297,11 +297,11 @@ body { color: #000000; background-color: #FFFFFF; }
</SPAN><SPAN class=any1-space> </SPAN><SPAN class=any1-comment>// Is this a meta file or hand generated script?
</SPAN><SPAN class=any1-space> </SPAN><SPAN class=any1-reservedword>IF</SPAN><SPAN class=any1-space> </SPAN><SPAN class=any1-function>empty</SPAN><SPAN class=any1-symbol>( ::cHTMLFile )
::cContent := ;
</SPAN><SPAN class=any1-string>"&lt;HTML&gt;&lt;HEAD&gt;"</SPAN><SPAN class=any1-space> + </SPAN><SPAN class=any1-variable>HB_OSNewLine</SPAN><SPAN class=any1-symbol>() + ;
</SPAN><SPAN class=any1-string>"&lt;TITLE&gt;"</SPAN><SPAN class=any1-space> + ::cTitle + </SPAN><SPAN class=any1-string>"&lt;/TITLE&gt;"</SPAN><SPAN class=any1-space> + </SPAN><SPAN class=any1-variable>HB_OSNewLine</SPAN><SPAN class=any1-symbol>() + ;
</SPAN><SPAN class=any1-string>"&lt;HTML&gt;&lt;HEAD&gt;"</SPAN><SPAN class=any1-space> + </SPAN><SPAN class=any1-variable>hb_eol</SPAN><SPAN class=any1-symbol>() + ;
</SPAN><SPAN class=any1-string>"&lt;TITLE&gt;"</SPAN><SPAN class=any1-space> + ::cTitle + </SPAN><SPAN class=any1-string>"&lt;/TITLE&gt;"</SPAN><SPAN class=any1-space> + </SPAN><SPAN class=any1-variable>hb_eol</SPAN><SPAN class=any1-symbol>() + ;
</SPAN><SPAN class=any1-string>"&lt;BODY link='"</SPAN><SPAN class=any1-space> + ::cLinkColor + </SPAN><SPAN class=any1-string>"' "</SPAN><SPAN class=any1-space> + ;
</SPAN><SPAN class=any1-string>"vlink='"</SPAN><SPAN class=any1-space> + ::cvLinkColor + </SPAN><SPAN class=any1-string>"'&gt;"</SPAN><SPAN class=any1-space> + + </SPAN><SPAN class=any1-variable>HB_OSNewLine</SPAN><SPAN class=any1-symbol>() + ;
::cBody + </SPAN><SPAN class=any1-variable>HB_OSNewLine</SPAN><SPAN class=any1-symbol>() + ;
</SPAN><SPAN class=any1-string>"vlink='"</SPAN><SPAN class=any1-space> + ::cvLinkColor + </SPAN><SPAN class=any1-string>"'&gt;"</SPAN><SPAN class=any1-space> + + </SPAN><SPAN class=any1-variable>hb_eol</SPAN><SPAN class=any1-symbol>() + ;
::cBody + </SPAN><SPAN class=any1-variable>hb_eol</SPAN><SPAN class=any1-symbol>() + ;
</SPAN><SPAN class=any1-string>"&lt;/BODY&gt;&lt;/HTML&gt;"
</SPAN><SPAN class=any1-space> </SPAN><SPAN class=any1-reservedword>ELSE
</SPAN><SPAN class=any1-space> ::cContent := </SPAN><SPAN class=any1-string>""
@@ -361,8 +361,8 @@ body { color: #000000; background-color: #FFFFFF; }
</SPAN><SPAN class=any1-reservedword>LOCAL</SPAN><SPAN class=any1-space> Self := </SPAN><SPAN class=any1-variable>QSelf</SPAN><SPAN class=any1-symbol>()
</SPAN><SPAN class=any1-function>OutStd</SPAN><SPAN class=any1-symbol>( ;
</SPAN><SPAN class=any1-string>"HTTP/1.0 200 OK"</SPAN><SPAN class=any1-space> + </SPAN><SPAN class=any1-variable>HB_OSNewLine</SPAN><SPAN class=any1-symbol>() + ;
</SPAN><SPAN class=any1-string>"CONTENT-TYPE: TEXT/HTML"</SPAN><SPAN class=any1-space> + </SPAN><SPAN class=any1-variable>HB_OSNewLine</SPAN><SPAN class=any1-symbol>() + </SPAN><SPAN class=any1-variable>HB_OSNewLine</SPAN><SPAN class=any1-symbol>() + ;
</SPAN><SPAN class=any1-string>"HTTP/1.0 200 OK"</SPAN><SPAN class=any1-space> + </SPAN><SPAN class=any1-variable>hb_eol</SPAN><SPAN class=any1-symbol>() + ;
</SPAN><SPAN class=any1-string>"CONTENT-TYPE: TEXT/HTML"</SPAN><SPAN class=any1-space> + </SPAN><SPAN class=any1-variable>hb_eol</SPAN><SPAN class=any1-symbol>() + </SPAN><SPAN class=any1-variable>hb_eol</SPAN><SPAN class=any1-symbol>() + ;
::cContent )
</SPAN><SPAN class=any1-reservedword>RETURN</SPAN><SPAN class=any1-symbol>( Self )

View File

@@ -41,7 +41,7 @@ body { color: #000000; background-color: #FFFFFF; }
</SPAN><SPAN class=any1-reservedword>LOCAL</SPAN><SPAN class=any1-space> oHTML := </SPAN><SPAN class=any1-variable>THTML</SPAN><SPAN class=any1-symbol>():</SPAN><SPAN class=any1-variable>New</SPAN><SPAN class=any1-symbol>()
s_cNewLine := </SPAN><SPAN class=any1-variable>HB_OSNewLine</SPAN><SPAN class=any1-symbol>()
s_cNewLine := </SPAN><SPAN class=any1-variable>hb_eol</SPAN><SPAN class=any1-symbol>()
oHTML:</SPAN><SPAN class=any1-variable>SetTitle</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>"Harbour Power Demonstration"</SPAN><SPAN class=any1-space> )
oHTML:</SPAN><SPAN class=any1-variable>AddHead</SPAN><SPAN class=any1-symbol>( </SPAN><SPAN class=any1-string>"Harbour Project"</SPAN><SPAN class=any1-space> )