diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 299c26541a..599be878f2 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,65 @@ The license applies to all entries newer than 2009-04-28. */ +2012-07-20 21:01 UTC+0200 Viktor Szakats (vszakats syenar.net) + * contrib/hbct/tests/charhist.prg + * contrib/hbct/tests/csetarge.prg + * contrib/hbgd/tests/gdtestcl.prg + * examples/hbapollo/array.prg + * examples/httpsrv/uhttpd.prg + * formatting + + * contrib/hbmisc/tests/rtfclass.prg + ! fixes + + * contrib/hbmisc/tests/rtfclass.prg + * contrib/hbgd/tests/gdtestcl.prg + ! fixed to not use OS() with string + comparisons to detect host OS + + * contrib/gtwvg/wvgdlg.prg + * contrib/hbide/ideactions.prg + * contrib/hbide/ideconsole.prg + * contrib/hbide/idemain.prg + * contrib/hbide/idemisc.prg + * contrib/hbide/idetags.prg + * contrib/hbxbp/tests/xbpqtc.prg + * examples/gfspell/spell.prg + * examples/gtwvw/tests/cbtest6.prg + * examples/gtwvw/tests/ebtest7.prg + * examples/gtwvw/tests/prog0.prg + * examples/gtwvw/tests/prog1.prg + * examples/gtwvw/tests/prog2.prg + * examples/gtwvw/tests/wvwtest9.prg + * examples/hbvpdf/hbvpdf.prg + * examples/hbxlsxml/xlsxml_y.prg + * examples/hbxlsxml/xlsxml.prg + * tests/codebloc.prg + * tests/langmsg.prg + * tests/memvar.prg + * tests/statics.prg + * tests/testwarn.prg + * tests/tstmacro.prg + % removed superfluous parantheses from RETURN statements + + * examples/hbapollo/tests/test65.prg + * examples/hbapollo/tests/test66.prg + * examples/hbapollo/tests/test77.prg + ! fixed looking for Windows in fixed location + + * examples/hbapollo/tests/test25.prg + * examples/hbapollo/tests/test34.prg + * examples/hbapollo/tests/test35.prg + * examples/hbapollo/tests/test36.prg + * examples/hbapollo/tests/test37.prg + * examples/hbapollo/tests/test38.prg + * examples/hbapollo/tests/test49.prg + * examples/hbapollo/tests/test53.prg + * examples/hbapollo/tests/test56.prg + * examples/hbapollo/tests/test57.prg + * examples/hbapollo/tests/test58.prg + ! removed most hard-wired windows locations + 2012-07-20 14:02 UTC+0200 Viktor Szakats (harbour syenar.net) * include/clipdefs.h * include/extend.api diff --git a/harbour/contrib/gtwvg/wvgdlg.prg b/harbour/contrib/gtwvg/wvgdlg.prg index 3d73e9969a..b764a25ee1 100644 --- a/harbour/contrib/gtwvg/wvgdlg.prg +++ b/harbour/contrib/gtwvg/wvgdlg.prg @@ -212,13 +212,13 @@ METHOD WvgDialog:setFrameState( nState ) DO CASE CASE nState == WVGDLG_FRAMESTAT_MINIMIZED - RETURN ( ::sendMessage( WM_SYSCOMMAND, SC_MINIMIZE, 0 ) != 0 ) + RETURN ::sendMessage( WM_SYSCOMMAND, SC_MINIMIZE, 0 ) != 0 CASE nState == WVGDLG_FRAMESTAT_MAXIMIZED - RETURN ( ::sendMessage( WM_SYSCOMMAND, SC_MAXIMIZE, 0 ) != 0 ) + RETURN ::sendMessage( WM_SYSCOMMAND, SC_MAXIMIZE, 0 ) != 0 CASE nState == WVGDLG_FRAMESTAT_NORMALIZED - RETURN ( ::sendMessage( WM_SYSCOMMAND, SC_RESTORE, 0 ) != 0 ) + RETURN ::sendMessage( WM_SYSCOMMAND, SC_RESTORE, 0 ) != 0 ENDCASE diff --git a/harbour/contrib/hbct/tests/charhist.prg b/harbour/contrib/hbct/tests/charhist.prg index b239b1d6f7..79c9ac6bc9 100644 --- a/harbour/contrib/hbct/tests/charhist.prg +++ b/harbour/contrib/hbct/tests/charhist.prg @@ -65,9 +65,9 @@ PROCEDURE Main() // simple tests QOut( "Simple tests:" ) - QOut( [ charhist("Hello World !")] + "[109] == 3 ? --> ", charhist( "Hello World !" )[109] ) - QOut( [ aeval(charhist("Hello World !"),{|x|nTotal+=x})] ) - AEval( charhist( "Hello World !" ), { |x|nTotal += x } ) + QOut( [ charhist("Hello World !")] + "[109] == 3 ? --> ", charhist( "Hello World !" )[ 109 ] ) + QOut( [ aeval(charhist("Hello World !"), {| x | nTotal += x } ) ] ) + AEval( charhist( "Hello World !" ), {| x | nTotal += x } ) QOut( [ ==> nTotal == len("Hello World !") ? --> ], nTotal == Len( "Hello World !" ) ) QOut( "End test of CHARHIST()" ) diff --git a/harbour/contrib/hbct/tests/csetarge.prg b/harbour/contrib/hbct/tests/csetarge.prg index 202749e78e..87e3f76095 100644 --- a/harbour/contrib/hbct/tests/csetarge.prg +++ b/harbour/contrib/hbct/tests/csetarge.prg @@ -67,7 +67,7 @@ PROCEDURE main QOut( "" ) QOut( "Local error handler: " ) - olderr := ErrorBlock( { | oerr | myerrhandler( oerr ) } ) + olderr := ErrorBlock( {| oerr | myerrhandler( oerr ) } ) // standard behaviour on argument error QOut( "" ) @@ -209,7 +209,7 @@ FUNCTION myerrhandler( oerr ) QOut( " err:operation....:", oerr:operation ) QOut( " len(err:args)....:", Len( oerr:args ) ) FOR ni := 1 TO Len( oerr:args ) - QOut( " err:args[" + hb_ntos( ni ) + "]..:", oerr:args[ni] ) + QOut( " err:args[" + hb_ntos( ni ) + "]..:", oerr:args[ ni ] ) NEXT QOut( " err:genCode......:", oerr:genCode ) QOut( " err:subCode......:", oerr:subCode ) @@ -238,7 +238,7 @@ FUNCTION myerrhandler( oerr ) QOut( " 6 is Block, 7 is Array, 8 is Object" ) QOut( " 9 is unknown" ) nDigit := Int( oerr:subCode % 10 ) - QOut( " Here it's a " + AllTrim( Str(nDigit ) ) + ", so I return a " ) + QOut( " Here it's a " + AllTrim( Str( nDigit ) ) + ", so I return a " ) DO CASE CASE nDigit == 0 QQOut( "NIL." ) @@ -266,7 +266,7 @@ FUNCTION myerrhandler( oerr ) CASE nDigit == 6 QQOut( "Block." ) - Input := { ||NIL } + Input := {|| NIL } CASE nDigit == 7 QQOut( "Array." ) diff --git a/harbour/contrib/hbgd/tests/gdtestcl.prg b/harbour/contrib/hbgd/tests/gdtestcl.prg index bd9cf2f684..c8d3321309 100644 --- a/harbour/contrib/hbgd/tests/gdtestcl.prg +++ b/harbour/contrib/hbgd/tests/gdtestcl.prg @@ -180,9 +180,9 @@ PROCEDURE Main() //oI4:SetColor( black ) //oI4:Say( 100, 10, "Valentina" ) - IF Left( OS(), Len( "Linux" ) ) == "Linux" + #if defined( __PLATFORM__UNIX ) oI4:SayFreeType( oI4:CenterWidth(), oI4:CenterHeight(), "GD power", "arib____", 40, 45 ) - ELSE + #else nSecs := Seconds() ? "start write" FOR n := 0 TO 350 STEP 10 @@ -192,7 +192,7 @@ PROCEDURE Main() oI4:SetTransparent( blue ) oI4:SayFreeType( oI4:CenterWidth() - 4, oI4:CenterHeight() + 4, "GD", "verdana", 70, n, gray ) oI4:SayFreeType( oI4:CenterWidth(), oI4:CenterHeight(), "GD", "verdana", 70, n, blue ) - ENDIF + #endif oI4:SaveJpeg( IMAGES_OUT + "writing.jpg" ) diff --git a/harbour/contrib/hbide/ideactions.prg b/harbour/contrib/hbide/ideactions.prg index 363f0282ae..59cb27bd82 100644 --- a/harbour/contrib/hbide/ideactions.prg +++ b/harbour/contrib/hbide/ideactions.prg @@ -686,7 +686,7 @@ STATIC FUNCTION mnuNormalizeItem( cCaption ) cKey := '' ENDIF - RETURN ( cIco + cCaption + cKey ) + RETURN cIco + cCaption + cKey /*----------------------------------------------------------------------*/ /* diff --git a/harbour/contrib/hbide/ideconsole.prg b/harbour/contrib/hbide/ideconsole.prg index 073e54c327..571f1b0d89 100644 --- a/harbour/contrib/hbide/ideconsole.prg +++ b/harbour/contrib/hbide/ideconsole.prg @@ -3167,7 +3167,7 @@ STATIC FUNCTION VouchGetColor( cType, cColor ) /*----------------------------------------------------------------------*/ FUNCTION VouchInRange( v, r1, r2 ) - RETURN ( v >= r1 .AND. v <= r2 ) + RETURN v >= r1 .AND. v <= r2 /*----------------------------------------------------------------------*/ @@ -3184,7 +3184,7 @@ FUNCTION pad_max( a_,lNum,max ) /*----------------------------------------------------------------------*/ FUNCTION VouchInArray( v,a_ ) - RETURN( ascan( a_,{|e| e = v } ) > 0 ) + RETURN ascan( a_,{|e| e = v } ) > 0 //----------------------------------------------------------------------// @@ -3553,7 +3553,7 @@ FUNCTION xtos( x ) //----------------------------------------------------------------------// FUNCTION VouchRgb( nR, nG, nB ) - RETURN ( nR +( nG * 256 ) +( nB * 256 * 256 ) ) + RETURN nR +( nG * 256 ) +( nB * 256 * 256 ) //---------------------------------------------------------------------// @@ -4474,7 +4474,7 @@ FUNCTION VouchAChoice( nTop, nLft, nBtm, nRgt, acItems, xSelect, cUserFunc, nPos SetCursor( crs ) - RETURN ( nChoice ) + RETURN nChoice /*----------------------------------------------------------------------*/ @@ -5171,7 +5171,7 @@ STATIC FUNCTION Before( cDelim, cValue ) cRetVal := left( cValue, at( cDelim, cValue ) - 1 ) ENDIF - RETURN ( cRetVal ) + RETURN cRetVal //----------------------------------------------------------------------// @@ -5182,7 +5182,7 @@ STATIC FUNCTION After( cDelim, cValue ) cRetVal := substr( cValue, at( cDelim, cValue ) + 1 ) ENDIF - RETURN ( cRetVal ) + RETURN cRetVal /*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/idemain.prg b/harbour/contrib/hbide/idemain.prg index cf8fb5a07f..5d91d6f3ce 100644 --- a/harbour/contrib/hbide/idemain.prg +++ b/harbour/contrib/hbide/idemain.prg @@ -1582,7 +1582,7 @@ METHOD HbIde:CreateTags() ENDIF NEXT - RETURN ( NIL ) + RETURN NIL //----------------------------------------------------------------------// /* diff --git a/harbour/contrib/hbide/idemisc.prg b/harbour/contrib/hbide/idemisc.prg index 885a6fc6ad..1058b8cc86 100644 --- a/harbour/contrib/hbide/idemisc.prg +++ b/harbour/contrib/hbide/idemisc.prg @@ -259,7 +259,7 @@ FUNCTION hbide_getYesNo( cMsg, cInfo, cTitle, qParent ) oMB:setParent( QWidget() ) - RETURN ( nRet == QMessageBox_Yes ) + RETURN nRet == QMessageBox_Yes /*----------------------------------------------------------------------*/ @@ -575,7 +575,7 @@ FUNCTION hbide_isValidText( cSourceFile ) hb_fNameSplit( cSourceFile, , , @cExt ) - RETURN ( lower( cExt ) $ hbide_setIde():oINI:cTextFileExtensions ) + RETURN lower( cExt ) $ hbide_setIde():oINI:cTextFileExtensions /*----------------------------------------------------------------------*/ @@ -584,7 +584,7 @@ FUNCTION hbide_isValidSource( cSourceFile ) hb_fNameSplit( cSourceFile, , , @cExt ) - RETURN ( lower( cExt ) $ ".c,.cpp,.prg,.res,.rc,.hb" ) + RETURN lower( cExt ) $ ".c,.cpp,.prg,.res,.rc,.hb" /*----------------------------------------------------------------------*/ @@ -593,7 +593,7 @@ FUNCTION hbide_isSourcePPO( cSourceFile ) hb_fNameSplit( cSourceFile, , , @cExt ) - RETURN ( lower( cExt ) == ".ppo" ) + RETURN lower( cExt ) == ".ppo" /*----------------------------------------------------------------------*/ @@ -602,7 +602,7 @@ FUNCTION hbide_isSourcePRG( cSourceFile ) hb_fNameSplit( cSourceFile, , , @cExt ) - RETURN ( lower( cExt ) == ".prg" ) + RETURN lower( cExt ) == ".prg" /*----------------------------------------------------------------------*/ @@ -852,7 +852,7 @@ FUNCTION hbide_parseKeyValPair( s, cKey, cVal ) lYes := ( !empty( cKey ) .and. !empty( cVal ) ) ENDIF - RETURN ( lYes ) + RETURN lYes /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbide/idetags.prg b/harbour/contrib/hbide/idetags.prg index 0cb0f1ad87..9fc4dbfc63 100644 --- a/harbour/contrib/hbide/idetags.prg +++ b/harbour/contrib/hbide/idetags.prg @@ -323,7 +323,7 @@ FUNCTION Summarize( aText, cComments, aSumData, nFileType ) ENDIF NEXT - RETURN( aSummary ) + RETURN aSummary /*----------------------------------------------------------------------*/ /* @@ -419,7 +419,7 @@ FUNCTION CheckComments( aText ) NEXT - RETURN ( cComments ) + RETURN cComments /*----------------------------------------------------------------------*/ @@ -443,6 +443,6 @@ STATIC FUNCTION IsInString( cText, nPos, nStart, cQuote ) ENDIF NEXT - RETURN ( lInString ) + RETURN lInString /*----------------------------------------------------------------------*/ diff --git a/harbour/contrib/hbmisc/tests/rtfclass.prg b/harbour/contrib/hbmisc/tests/rtfclass.prg index 62efb1eca8..7823e13581 100644 --- a/harbour/contrib/hbmisc/tests/rtfclass.prg +++ b/harbour/contrib/hbmisc/tests/rtfclass.prg @@ -38,10 +38,10 @@ PROCEDURE Main() ortf:close() // execute file association ( windows only ) - IF Lower( OS() ) == "windows" + #if defined( __PLATFORM__WINDOWS ) // assuming start.exe is exist __Run( "start test.rtf" ) - ENDIF + #endif RETURN @@ -74,44 +74,31 @@ STATIC FUNCTION new( cfilename ) STATIC FUNCTION write( csource ) LOCAL self := qself() - LOCAL cchar, cline, xatt, i, _xatt - LOCAL n, nchar, xchar, y + LOCAL cchar, cline, xatt, i + LOCAL nchar, y // These are character attributes, self-defined // + means a turn-on // - means a turn-off LOCAL attrib := { ; - { "+b" , "\b " } /* turn bold on*/ - , ; - { "+bu" , "\ul\b " } /* turn bold_underline on */ - , ; - { "+bi" , "\b\i " } /* turn bold_italic on */ - , ; - { "+bui", "\ul\b\i " } /* turn bold_underline_italic on */ - , ; - { "+i" , "\i " } /* turn italic on */ - , ; - { "+il" , "\ul\i " } /* turn italic_underline on */ - , ; - { "+u" , "\ul " } /* turn underline on */ - , ; - { "-b" , "\b0 " } /* turn bold off */ - , ; - { "-bu" , "\b0\ulnone " } /* turn bold_underline off */ - , ; - { "-bi" , "\b0\i0 " } /* turn bold_italic off */ - , ; - { "-bui", "\b0\i0\ulnone " } /* turn bold_underline_italic off */ - , ; - { "-i" , "\i0 " } /* turn italic off */ - , ; - { "-il" , "\ulnone\i0 " } /* turn italic_underline off */ - , ; - { "-u" , "\ulnone " } /* turn underline off */ + { "+b" , "\b " } /* turn bold on*/ , ; + { "+bu" , "\ul\b " } /* turn bold_underline on */, ; + { "+bi" , "\b\i " } /* turn bold_italic on */, ; + { "+bui", "\ul\b\i " } /* turn bold_underline_italic on */, ; + { "+i" , "\i " } /* turn italic on */, ; + { "+il" , "\ul\i " } /* turn italic_underline on */, ; + { "+u" , "\ul " } /* turn underline on */, ; + { "-b" , "\b0 " } /* turn bold off */, ; + { "-bu" , "\b0\ulnone " } /* turn bold_underline off */, ; + { "-bi" , "\b0\i0 " } /* turn bold_italic off */, ; + { "-bui", "\b0\i0\ulnone " } /* turn bold_underline_italic off */, ; + { "-i" , "\i0 " } /* turn italic off */, ; + { "-il" , "\ulnone\i0 " } /* turn italic_underline off */, ; + { "-u" , "\ulnone " } /* turn underline off */; } hb_fuse( csource ) // open source file - WHILE !hb_FEof() // read the file line by line + WHILE ! hb_FEof() // read the file line by line cline := hb_freadln() + "\par" y := Len( cline ) for nchar := 1 TO y @@ -125,20 +112,20 @@ STATIC FUNCTION write( csource ) SubStr( cline, nchar + 1, 1 ) + ; SubStr( cline, nchar + 2, 1 ) + ; SubStr( cline, nchar + 3, 1 ) - IF ( i := AScan( attrib, { |e| e[1] == xatt } ) ) > 0 - FWrite( ::nhandle, attrib[i][2] ) + IF ( i := AScan( attrib, {| e | e[ 1 ] == xatt } ) ) > 0 + FWrite( ::nhandle, attrib[ i ][ 2 ] ) nchar := nchar + Len( xatt ) - 1 ELSE // 3 attributes xatt := Left( xatt, 3 ) - IF ( i := AScan( attrib, { |e| e[1] == xatt } ) ) > 0 - FWrite( ::nhandle, attrib[i][2] ) + IF ( i := AScan( attrib, {| e | e[ 1 ] == xatt } ) ) > 0 + FWrite( ::nhandle, attrib[ i ][ 2 ] ) nchar := nchar + Len( xatt ) - 1 ELSE // 2 attributes xatt := Left( xatt, 2 ) - IF ( i := AScan( attrib, { |e| e[1] == xatt } ) ) > 0 - FWrite( ::nhandle, attrib[i][2] ) + IF ( i := AScan( attrib, {| e | e[ 1 ] == xatt } ) ) > 0 + FWrite( ::nhandle, attrib[ i ][ 2 ] ) nchar := nchar + Len( xatt ) - 1 ELSE FWrite( ::nhandle, cchar ) @@ -154,7 +141,7 @@ STATIC FUNCTION write( csource ) ENDDO hb_fuse() - RETURN ( self ) + RETURN self STATIC FUNCTION CLOSE() diff --git a/harbour/contrib/hbxbp/tests/xbpqtc.prg b/harbour/contrib/hbxbp/tests/xbpqtc.prg index abb99e5ec3..cf963f3762 100644 --- a/harbour/contrib/hbxbp/tests/xbpqtc.prg +++ b/harbour/contrib/hbxbp/tests/xbpqtc.prg @@ -316,7 +316,7 @@ Function CreateInnerChildWindow( oODlg ) oDlg:show() SetAppFocus( oDlg ) - Return( NIL ) + Return NIL /*----------------------------------------------------------------------*/ @@ -344,7 +344,7 @@ Function CreateOuterChildWindow( oODlg, lMoveWithOwner ) SetAppFocus( oDlg ) - Return( NIL ) + Return NIL /*----------------------------------------------------------------------*/ diff --git a/harbour/examples/gfspell/spell.prg b/harbour/examples/gfspell/spell.prg index e830fc4646..67b9e4f819 100644 --- a/harbour/examples/gfspell/spell.prg +++ b/harbour/examples/gfspell/spell.prg @@ -1649,4 +1649,4 @@ ENDIF ret_val := AT(f_str, SUBSTR(l_str, f_rom)) -RETURN(ret_val) +RETURN ret_val diff --git a/harbour/examples/gtwvw/tests/cbtest6.prg b/harbour/examples/gtwvw/tests/cbtest6.prg index ef5f9087e2..0fc7cb7ee9 100644 --- a/harbour/examples/gtwvw/tests/cbtest6.prg +++ b/harbour/examples/gtwvw/tests/cbtest6.prg @@ -254,7 +254,7 @@ FUNCTION CBreader( oGet ) oGet:killfocus() endif -RETURN (NIL) //cbreader() +RETURN NIL //cbreader() /* not used: static function MoveToGet(GetList, nPos) diff --git a/harbour/examples/gtwvw/tests/ebtest7.prg b/harbour/examples/gtwvw/tests/ebtest7.prg index ab2eaadf8f..7fd7874f79 100644 --- a/harbour/examples/gtwvw/tests/ebtest7.prg +++ b/harbour/examples/gtwvw/tests/ebtest7.prg @@ -927,4 +927,4 @@ return win_messagebox(nParent, cMessage, cCaption, nFlags) static function lShiftPressed() // #define VK_SHIFT 16 -return (wvw_GETKEYSTATE(16) < 0) +return wvw_GETKEYSTATE(16) < 0 diff --git a/harbour/examples/gtwvw/tests/prog0.prg b/harbour/examples/gtwvw/tests/prog0.prg index 6ae89d50d1..8eac66c6ca 100644 --- a/harbour/examples/gtwvw/tests/prog0.prg +++ b/harbour/examples/gtwvw/tests/prog0.prg @@ -257,7 +257,7 @@ local oldColor := setcolor(s_cStdColor) setcursor(oldCurs) setcolor(oldColor) -return (nChoice==1) +return nChoice==1 function lBoxMessage(cMsg, cTitle) local nTopLine, ; @@ -335,7 +335,7 @@ FUNCTION ZNEWWINDOW(wtype,r1,c1,r2,c2,ctitle, ccolor) endif SETCOLOR(cOldColor) -RETURN(i+1) +RETURN i+1 FUNCTION ZREVWINDOW() * Closes the last window and remove it from window list @@ -354,7 +354,7 @@ FUNCTION ZREVWINDOW() * remove window from list adel(s_zwin, i) asize(s_zwin, len(s_zwin)-1) -RETURN(NIL) +RETURN NIL function nCeiling(nNumber) local nTemp diff --git a/harbour/examples/gtwvw/tests/prog1.prg b/harbour/examples/gtwvw/tests/prog1.prg index ff0e1dcc4d..a949b7b3b7 100644 --- a/harbour/examples/gtwvw/tests/prog1.prg +++ b/harbour/examples/gtwvw/tests/prog1.prg @@ -281,7 +281,7 @@ local oldColor := setcolor(s_cStdColor) setcursor(oldCurs) setcolor(oldColor) -return (nChoice==1) +return nChoice==1 function lBoxMessage(cMsg, cTitle) local nTopLine, ; @@ -365,7 +365,7 @@ FUNCTION ZNEWWINDOW(wtype,r1,c1,r2,c2,ctitle, ccolor) #ENDIF SETCOLOR(cOldColor) -RETURN(i+1) +RETURN i+1 FUNCTION ZREVWINDOW() * Closes the last window and remove it from window list @@ -388,7 +388,7 @@ FUNCTION ZREVWINDOW() * remove window from list adel(s_zwin, i) asize(s_zwin, len(s_zwin)-1) -RETURN(NIL) +RETURN NIL function nCeiling(nNumber) local nTemp diff --git a/harbour/examples/gtwvw/tests/prog2.prg b/harbour/examples/gtwvw/tests/prog2.prg index 058d0d1dc9..cad83d8d14 100644 --- a/harbour/examples/gtwvw/tests/prog2.prg +++ b/harbour/examples/gtwvw/tests/prog2.prg @@ -322,7 +322,7 @@ local oldColor := setcolor(s_cStdColor) setcursor(oldCurs) setcolor(oldColor) -return (nChoice==1) +return nChoice==1 function lBoxMessage(cMsg, cTitle) local nTopLine, ; @@ -407,7 +407,7 @@ FUNCTION ZNEWWINDOW(wtype,r1,c1,r2,c2,ctitle, ccolor) #ENDIF SETCOLOR(cOldColor) -RETURN(i+1) +RETURN i+1 FUNCTION ZREVWINDOW() * Closes the last window and remove it from window list @@ -431,7 +431,7 @@ FUNCTION ZREVWINDOW() * remove window from list adel(s_zwin, i) asize(s_zwin, len(s_zwin)-1) -RETURN(NIL) +RETURN NIL function nCeiling(nNumber) local nTemp diff --git a/harbour/examples/gtwvw/tests/wvwtest9.prg b/harbour/examples/gtwvw/tests/wvwtest9.prg index f0b630dba6..1fa57238c1 100644 --- a/harbour/examples/gtwvw/tests/wvwtest9.prg +++ b/harbour/examples/gtwvw/tests/wvwtest9.prg @@ -1070,7 +1070,7 @@ return .t. function lYesNo(cMsg, cTitle) default cTitle to "Konfirmasi" -return (win_messagebox(WVW_GETWINDOWHANDLE(), cMsg, cTitle, MB_YESNO + MB_ICONQUESTION + MB_SYSTEMMODAL) == IDYES) +return win_messagebox(WVW_GETWINDOWHANDLE(), cMsg, cTitle, MB_YESNO + MB_ICONQUESTION + MB_SYSTEMMODAL) == IDYES function lDebug(cMsg) return lBoxMessage(cMsg, "Debug") @@ -1181,7 +1181,7 @@ FUNCTION SetDefaultWindowSize() CLS ENDIF ENDIF -RETURN(Result) +RETURN Result //static function isWinNT() //return lYesNo("I am preparing the 'best' font for you..." + CRLF+; diff --git a/harbour/examples/hbapollo/array.prg b/harbour/examples/hbapollo/array.prg index 460278d3cb..c200fc45cd 100644 --- a/harbour/examples/hbapollo/array.prg +++ b/harbour/examples/hbapollo/array.prg @@ -87,7 +87,7 @@ STATIC FUNCTION _ftsavesub( xMemVar, nHandle, nErrorCode ) nLen := Len( xMemVar ) FWrite( nHandle, L2Bin( nLen ), 4 ) IF FError() = 0 - AEval( xMemVar, { |xMemVar1| lRet := _ftsavesub( xMemVar1, nHandle ) } ) + AEval( xMemVar, {| xMemVar1 | lRet := _ftsavesub( xMemVar1, nHandle ) } ) ELSE lRet = .F. ENDIF diff --git a/harbour/examples/hbapollo/tests/test25.prg b/harbour/examples/hbapollo/tests/test25.prg index f61d89d3c8..d74a4ae070 100644 --- a/harbour/examples/hbapollo/tests/test25.prg +++ b/harbour/examples/hbapollo/tests/test25.prg @@ -40,8 +40,8 @@ PROCEDURE MAIN() APPEND BLANK 10000 j := 0 - SX_DBEVAL( { ||; - cPad := PADL( ++ j, 5, "0" ), ; + SX_DBEVAL( {||; + cPad := PADL( ++j, 5, "0" ), ; SX_REPLACEEX( { ; { "MYDATE", date() + j }, ; { "MYCHAR", "NAME_" + cPad }, ; diff --git a/harbour/examples/hbapollo/tests/test34.prg b/harbour/examples/hbapollo/tests/test34.prg index 666108fd8a..7d402728dc 100644 --- a/harbour/examples/hbapollo/tests/test34.prg +++ b/harbour/examples/hbapollo/tests/test34.prg @@ -24,8 +24,8 @@ PROCEDURE MAIN() SET EPOCH 1950 SET DATE "DD/MM/YYYY" - IF File( "C:\WINDOWS\TEMP\myText.Txt" ) - FErase( "C:\WINDOWS\TEMP\myText.Txt" ) + IF File( "mytext.txt" ) + FErase( "mytext.txt" ) ENDIF CREATE DBF cFile STRUCT aStruct RDD SDENSX @@ -61,7 +61,7 @@ Delimiter should be one of the followings: SPACE_DELIM */ - COPYTEXT TO C:\WINDOWS\TEMP\mytext.txt DELIMITED WITH TAB_DELIM + COPYTEXT TO mytext.txt DELIMITED WITH TAB_DELIM // COPYTEXT TO mytext.txt DELIMITED WITH COMMA_DELIM // COPYTEXT TO mytext.txt DELIMITED WITH SDF_DELIM // COPYTEXT TO mytext.txt DELIMITED WITH SPACE_DELIM @@ -71,7 +71,7 @@ Delimiter should be one of the followings: IF !empty( cApplication := appReg( "txt" ) ) ? 'Now will browse text file ... Press any key ...' PAUSE - IF File( "c:\windows\temp\myText.Txt" ) - __run( cApplication + " " + "c:\windows\temp\mytext.txt" ) + IF File( "mytext.txt" ) + __run( cApplication + " " + "mytext.txt" ) ENDIF ENDIF diff --git a/harbour/examples/hbapollo/tests/test35.prg b/harbour/examples/hbapollo/tests/test35.prg index 1fac5beb1b..154487476a 100644 --- a/harbour/examples/hbapollo/tests/test35.prg +++ b/harbour/examples/hbapollo/tests/test35.prg @@ -12,7 +12,7 @@ PROCEDURE MAIN() - LOCAL cFile := "c:\windows\temp\sixtest.dbf" + LOCAL cFile := "sixtest.dbf" LOCAL aStruct := { ; { "MYCHAR" , "C", 15, 0 }, ; { "MYDATE" , "D", 8, 0 }, ; @@ -25,8 +25,8 @@ PROCEDURE MAIN() SET EPOCH 1950 SET DATE "DD/MM/YYYY" - IF File( "c:\windows\temp\myText.Txt" ) - FErase( "c:\windows\temp\myText.Txt" ) + IF File( "mytext.txt" ) + FErase( "mytext.txt" ) ENDIF CREATE DBF cFile STRUCT aStruct RDD SDENSX @@ -68,7 +68,7 @@ PROCEDURE MAIN() // if no FIELDS clause is used, all fields will be printed // COPY TO mytext.txt ; // DELIMITED clause should come last - COPY TO c:\windows\temp\mytext.txt FIELDS MYCHAR, MYDATE, MYNUMBER1, MYNUMBER2, MYMEMO ; + COPY TO mytext.txt FIELDS MYCHAR, MYDATE, MYNUMBER1, MYNUMBER2, MYMEMO ; FOR sx_GetValue( "MYDATE" ) <= CTOD( "31/12/2008" ) ; NEXT 100 DELIMITED WITH CHR( 9 ) @@ -80,14 +80,14 @@ PROCEDURE MAIN() CLOSE ALL - // if file("c:\windows\temp\mytext.txt") - // ? 'File c:\windows\temp\mytext.txt created ...' + // if file("mytext.txt") + // ? 'File mytext.txt created ...' // endif IF !empty( cApplication := appReg( "txt" ) ) ? 'Now will browse text file ... Press any key ...' PAUSE - IF File( "c:\windows\temp\myText.Txt" ) - __Run( cApplication + " " + "c:\windows\temp\mytext.txt" ) + IF File( "mytext.txt" ) + __Run( cApplication + " " + "mytext.txt" ) ENDIF ENDIF diff --git a/harbour/examples/hbapollo/tests/test36.prg b/harbour/examples/hbapollo/tests/test36.prg index a386570edd..6b5ffdd513 100644 --- a/harbour/examples/hbapollo/tests/test36.prg +++ b/harbour/examples/hbapollo/tests/test36.prg @@ -12,7 +12,7 @@ PROCEDURE MAIN() - LOCAL cFile := "c:\windows\temp\sixtest.dbf" + LOCAL cFile := "sixtest.dbf" LOCAL aStruct := { ; { "MYCHAR" , "C", 15, 0 }, ; { "MYDATE" , "D", 8, 0 }, ; @@ -25,8 +25,8 @@ PROCEDURE MAIN() SET EPOCH 1950 SET DATE "DD/MM/YYYY" - IF File( "c:\windows\temp\myText.Txt" ) - FErase( "c:\windows\temp\myText.Txt" ) + IF File( "mytext.txt" ) + FErase( "mytext.txt" ) ENDIF CREATE DBF cFile STRUCT aStruct RDD SDENSX @@ -68,7 +68,7 @@ PROCEDURE MAIN() // if no FIELDS clause is used, all fields will be printed // COPY TO mytext.txt ; // DELIMITED clause should come last - COPY TO c:\windows\temp\mytext.txt SDF FIELDS MYCHAR, MYDATE, MYNUMBER1, MYNUMBER2, MYMEMO ; + COPY TO mytext.txt SDF FIELDS MYCHAR, MYDATE, MYNUMBER1, MYNUMBER2, MYMEMO ; FOR sx_GetValue( "MYDATE" ) <= CTOD( "31/12/2003" ) ; NEXT 100 @@ -80,14 +80,14 @@ PROCEDURE MAIN() CLOSE ALL - // if file("c:\windows\temp\mytext.txt") - // ? 'File c:\windows\temp\mytext.txt created ...' + // if file("mytext.txt") + // ? 'File mytext.txt created ...' // endif IF !empty( cApplication := appReg( "txt" ) ) ? 'Now will browse text file ... Press any key ...' PAUSE - IF File( "c:\windows\temp\myText.Txt" ) - __run( cApplication + " " + "c:\windows\temp\mytext.txt" ) + IF File( "mytext.txt" ) + __run( cApplication + " " + "mytext.txt" ) ENDIF ENDIF diff --git a/harbour/examples/hbapollo/tests/test37.prg b/harbour/examples/hbapollo/tests/test37.prg index f814ccfa8f..9b8f4a9030 100644 --- a/harbour/examples/hbapollo/tests/test37.prg +++ b/harbour/examples/hbapollo/tests/test37.prg @@ -11,7 +11,7 @@ PROCEDURE MAIN() - LOCAL cFile := "c:\windows\temp\sixtest.dbf" + LOCAL cFile := "sixtest.dbf" LOCAL aStruct := { ; { "MYCHAR" , "C", 15, 0 }, ; { "MYDATE" , "D", 8, 0 }, ; @@ -24,8 +24,8 @@ PROCEDURE MAIN() SET EPOCH 1950 SET DATE "DD/MM/YYYY" - IF File( "c:\windows\temp\myText.Txt" ) - FErase( "c:\windows\temp\myText.Txt" ) + IF File( "mytext.txt" ) + FErase( "mytext.txt" ) ENDIF CREATE DBF cFile STRUCT aStruct diff --git a/harbour/examples/hbapollo/tests/test38.prg b/harbour/examples/hbapollo/tests/test38.prg index 08ae998bcc..df2fb600da 100644 --- a/harbour/examples/hbapollo/tests/test38.prg +++ b/harbour/examples/hbapollo/tests/test38.prg @@ -11,7 +11,7 @@ PROCEDURE MAIN() - LOCAL cFile := "c:\windows\temp\sixtest.dbf" + LOCAL cFile := "sixtest.dbf" LOCAL aStruct := { ; { "MYCHAR" , "C", 15, 0 }, ; { "MYDATE" , "D", 8, 0 }, ; @@ -24,8 +24,8 @@ PROCEDURE MAIN() SET EPOCH 1950 SET DATE "DD/MM/YYYY" - IF File( "c:\windows\temp\myText.Txt" ) - FErase( "c:\windows\temp\myText.Txt" ) + IF File( "mytext.txt" ) + FErase( "mytext.txt" ) ENDIF CREATE DBF cFile STRUCT aStruct diff --git a/harbour/examples/hbapollo/tests/test49.prg b/harbour/examples/hbapollo/tests/test49.prg index a3a24913ae..bd71eb6659 100644 --- a/harbour/examples/hbapollo/tests/test49.prg +++ b/harbour/examples/hbapollo/tests/test49.prg @@ -28,7 +28,7 @@ PROCEDURE MAIN() ? 'sx_LockCount() =', __trim( sx_LockCount() ) aLockList := sx_DBRlockList() ? 'aLockList := sx_DBRlockList() =>', __trim( len( aLockList ) ) - aeval( aLockList, { |e, i| outstd( "aLockList[" + __trim(i ) + "] = " + __trim(e ), hb_eol() ) } ) + aeval( aLockList, {| e, i | outstd( "aLockList[" + __trim(i ) + "] = " + __trim(e ), hb_eol() ) } ) ? ? 'sx_Unlock( 10 ) =', sx_Unlock( 10 ) @@ -42,7 +42,7 @@ PROCEDURE MAIN() ? 'sx_LockCount() =', __trim( sx_LockCount() ) aLockList := sx_DBRlockList() ? 'aLockList := sx_DBRlockList() =>', __trim( len( aLockList ) ) - aeval( aLockList, { |e, i| outstd( "aLockList[" + __trim(i ) + "] = " + __trim(e ), hb_eol() ) } ) + aeval( aLockList, {| e, i | outstd( "aLockList[" + __trim(i ) + "] = " + __trim(e ), hb_eol() ) } ) ? ? 'sx_Rlock( 10 ) =', sx_Rlock( 10 ) @@ -58,7 +58,7 @@ PROCEDURE MAIN() ? 'sx_LockCount() =', __trim( sx_LockCount() ) aLockList := sx_DBRlockList() ? 'aLockList := sx_DBRlockList() =>', __trim( len( aLockList ) ) - aeval( aLockList, { |e, i| outstd( "aLockList[" + __trim(i ) + "] = " + __trim(e ), hb_eol() ) } ) + aeval( aLockList, {| e, i | outstd( "aLockList[" + __trim(i ) + "] = " + __trim(e ), hb_eol() ) } ) sx_UnLockAll() @@ -67,7 +67,7 @@ PROCEDURE MAIN() ? 'sx_LockCount() =', __trim( sx_LockCount() ) aLockList := sx_DBRlockList() ? 'aLockList := sx_DBRlockList() =>', __trim( len( aLockList ) ) - aeval( aLockList, { |e, i| outstd( "aLockList[" + __trim(i ) + "] = " + __trim(e ), hb_eol() ) } ) + aeval( aLockList, {| e, i | outstd( "aLockList[" + __trim(i ) + "] = " + __trim(e ), hb_eol() ) } ) ? sx_LastRec() @@ -77,7 +77,7 @@ PROCEDURE MAIN() ? 'sx_LockCount() =', __trim( sx_LockCount() ) aLockList := sx_DBRlockList() ? 'aLockList := sx_DBRlockList() =>', __trim( len( aLockList ) ) - aeval( aLockList, { |e, i| outstd( "aLockList[" + __trim(i ) + "] = " + __trim(e ), hb_eol() ) } ) + aeval( aLockList, {| e, i | outstd( "aLockList[" + __trim(i ) + "] = " + __trim(e ), hb_eol() ) } ) ? ? 'sx_DbrUnLock( aLockList ) =', sx_DbrUnLock( aLockList ) // ? 'sx_UnLock( aLockList ) =', sx_UnLock( aLockList ) @@ -85,7 +85,7 @@ PROCEDURE MAIN() ? 'sx_LockCount() =', __trim( sx_LockCount() ) aLockList := sx_DBRlockList() ? 'aLockList := sx_DBRlockList() =>', __trim( len( aLockList ) ) - aeval( aLockList, { |e, i| outstd( "aLockList[" + __trim(i ) + "] = " + __trim(e ), hb_eol() ) } ) + aeval( aLockList, {| e, i | outstd( "aLockList[" + __trim(i ) + "] = " + __trim(e ), hb_eol() ) } ) ? 'sx_LastRec() =', sx_LastRec() ? 'sx_RecCount() =', sx_RecCount() diff --git a/harbour/examples/hbapollo/tests/test53.prg b/harbour/examples/hbapollo/tests/test53.prg index 0d41e075b3..3033e4d878 100644 --- a/harbour/examples/hbapollo/tests/test53.prg +++ b/harbour/examples/hbapollo/tests/test53.prg @@ -85,7 +85,7 @@ FUNCTION Test_1( nCommit ) APPEND BLANK 10000 j := 0 sx_DbEval( ; - { || cPad := PADL( ++ j, 5, "0" ) , ; + {|| cPad := PADL( ++j, 5, "0" ) , ; sx_ReplaceEx( { ; { "MYCHAR", "NAME_" + cPad } , ; { "MYDATE", date() + j } , ; diff --git a/harbour/examples/hbapollo/tests/test56.prg b/harbour/examples/hbapollo/tests/test56.prg index 6655f9220b..0fa998f228 100644 --- a/harbour/examples/hbapollo/tests/test56.prg +++ b/harbour/examples/hbapollo/tests/test56.prg @@ -10,7 +10,7 @@ PROCEDURE MAIN() - LOCAL cFile := "c:\windows\temp\sixtest.dbf" + LOCAL cFile := "sixtest.dbf" LOCAL aStruct := { ; { "FIRST", "C", 25, 0 }, ; { "LAST", "C", 25, 0 }, ; diff --git a/harbour/examples/hbapollo/tests/test57.prg b/harbour/examples/hbapollo/tests/test57.prg index 326bce6d31..8ae6b94bf3 100644 --- a/harbour/examples/hbapollo/tests/test57.prg +++ b/harbour/examples/hbapollo/tests/test57.prg @@ -10,7 +10,7 @@ PROCEDURE MAIN() - LOCAL cFile := "c:\windows\temp\sixtest.dbf" + LOCAL cFile := "sixtest.dbf" LOCAL aStruct := { ; { "FIRST", "C", 25, 0 }, ; { "LAST", "C", 25, 0 }, ; diff --git a/harbour/examples/hbapollo/tests/test58.prg b/harbour/examples/hbapollo/tests/test58.prg index ddcbfc8f96..6be0ba46a0 100644 --- a/harbour/examples/hbapollo/tests/test58.prg +++ b/harbour/examples/hbapollo/tests/test58.prg @@ -11,7 +11,7 @@ PROCEDURE MAIN() - LOCAL cFile := "c:\windows\temp\sixtest.dbf" + LOCAL cFile := "sixtest.dbf" LOCAL aStruct := { ; { "FIRST", "C", 25, 0 }, ; { "LAST", "C", 25, 0 }, ; diff --git a/harbour/examples/hbapollo/tests/test65.prg b/harbour/examples/hbapollo/tests/test65.prg index 570c54a526..9cae349d9c 100644 --- a/harbour/examples/hbapollo/tests/test65.prg +++ b/harbour/examples/hbapollo/tests/test65.prg @@ -14,15 +14,15 @@ PROCEDURE MAIN() LOCAL s, t LOCAL aStruct1 := { { "NO","C",5,0 }, { "BINARY","M",10,0 } } - SET DATE "dd/mm/yyyy" + SET DATE ANSI CREATE TABLE "TEST1" STRUCT aStruct1 RDD SDEFOX USE "test1" ALIAS ONE RDD SDEFOX APPEND BLANK REPLACE NO WITH "001" - IF File( "C:\WINDOWS\SYSTEM.INI" ) - sx_ReplaceBLOB( "BINARY", "C:\WINDOWS\SYSTEM.INI" ) + IF File( GetEnv( "WINDIR" ) + "\SYSTEM.INI" ) + sx_ReplaceBLOB( "BINARY", GetEnv( "WINDIR" ) + "\SYSTEM.INI" ) sx_Commit() ? sx_BLOBToFile( "BINARY", "test.ini" ) ELSE - ? "File C:\WINDOWS\SYSTEM.INI required for testing. Not found." + ? "File " + GetEnv( "WINDIR" ) + "\SYSTEM.INI required for testing. Not found." ENDIF diff --git a/harbour/examples/hbapollo/tests/test66.prg b/harbour/examples/hbapollo/tests/test66.prg index f11a5cc09c..2de046890d 100644 --- a/harbour/examples/hbapollo/tests/test66.prg +++ b/harbour/examples/hbapollo/tests/test66.prg @@ -14,17 +14,17 @@ PROCEDURE MAIN() LOCAL s, t LOCAL aStruct1 := { { "NO","C",5,0 }, { "BINARY","M",10,0 } } - SET DATE "dd/mm/yyyy" + SET DATE ANSI CREATE TABLE "TEST1" STRUCT aStruct1 RDD SDENSX USE "test1" ALIAS ONE RDD SDENSX //CREATE TABLE "TEST1" STRUCT aStruct1 RDD SDEFOX //use "test1" alias ONE RDD SDEFOX APPEND BLANK REPLACE NO WITH "001" - IF file( "C:\WINDOWS\ACD Wallpaper.bmp" ) - sx_ReplaceBitmap( "BINARY", "C:\WINDOWS\ACD Wallpaper.bmp" ) + IF file( GetEnv( "WINDIR" ) + "\ACD Wallpaper.bmp" ) + sx_ReplaceBitmap( "BINARY", GetEnv( "WINDIR" ) + ""\ACD Wallpaper.bmp" ) sx_Commit() ? sx_BLOBToFile( "BINARY", "test.bmp" ) ELSE - ? "File C:\WINDOWS\setup.bmp required for testing. Not found!" + ? "File " + GetEnv( "WINDIR" ) + "\ACD Wallpaper.bmp required for testing. Not found!" ENDIF diff --git a/harbour/examples/hbapollo/tests/test77.prg b/harbour/examples/hbapollo/tests/test77.prg index 8a4686824c..78c887fb7c 100644 --- a/harbour/examples/hbapollo/tests/test77.prg +++ b/harbour/examples/hbapollo/tests/test77.prg @@ -15,16 +15,16 @@ PROCEDURE MAIN() LOCAL s, t LOCAL aStruct1 := { { "NO","C",5,0 }, { "BINARY","M",10,0 } } - SET DATE "dd/mm/yyyy" + SET DATE ANSI CREATE TABLE "TEST1" STRUCT aStruct1 RDD SDEFOX USE "test1" ALIAS ONE RDD SDEFOX APPEND BLANK REPLACE NO WITH "001" - IF File( "C:\WINDOWS\SYSTEM.INI" ) - sx_ReplaceBLOB( "BINARY", "C:\WINDOWS\SYSTEM.INI" ) + IF File( GetEnv( "WINDIR" ) + "\SYSTEM.INI" ) + sx_ReplaceBLOB( "BINARY", GetEnv( "WINDIR" ) + "\SYSTEM.INI" ) sx_Commit() ? 'sx_GetBlobLength( "BINARY" ) =>', sx_GetBlobLength( "BINARY" ) ? 'sx_BLOBToFile( "BINARY", "test.ini" ) =>', sx_BLOBToFile( "BINARY", "test.ini" ) ELSE - ? "File C:\WINDOWS\SYSTEM.INI required for testing. Not found." + ? "File " + GetEnv( "WINDIR" ) + "\SYSTEM.INI required for testing. Not found." ENDIF diff --git a/harbour/examples/hbvpdf/hbvpdf.prg b/harbour/examples/hbvpdf/hbvpdf.prg index 9d6a6623dc..dc8dfcb998 100644 --- a/harbour/examples/hbvpdf/hbvpdf.prg +++ b/harbour/examples/hbvpdf/hbvpdf.prg @@ -2342,7 +2342,7 @@ local nSpace // := 3 // 3 - RGB, 1 - GREY, 4 - CMYK return aTemp STATIC FUNCTION FilePos( nHandle ) -RETURN ( FSEEK( nHandle, 0, FS_RELATIVE ) ) +RETURN FSEEK( nHandle, 0, FS_RELATIVE ) STATIC FUNCTION Chr_RGB( cChar ) RETURN str(asc( cChar ) / 255, 4, 2) @@ -2416,7 +2416,7 @@ STATIC FUNCTION FileSize( nHandle ) // Reset file position FSEEK( nHandle, nCurrent ) -RETURN ( nLength ) +RETURN nLength // next 3 function written by Peter Kulek //modified for compatibility with common.ch by V.K. diff --git a/harbour/examples/hbxlsxml/xlsxml.prg b/harbour/examples/hbxlsxml/xlsxml.prg index 7be3852cb3..9c22816789 100644 --- a/harbour/examples/hbxlsxml/xlsxml.prg +++ b/harbour/examples/hbxlsxml/xlsxml.prg @@ -9,7 +9,7 @@ * www - http://www.xharbour.org http://harbour-project.org * * Thanks TO Robert F Greer, PHP original version - * http://sourceforge.net/projects/excelwriterxml/ + * http://sourceforge.net/projects/excelwriterxml/ * * This program is free software; you can redistribute it AND/OR modify * it under the terms of the GNU General PUBLIC License as published by @@ -65,52 +65,52 @@ CREATE CLASS ExcelWriterXML DATA sheets INIT {} DATA lShowErrorSheet INIT .f. DATA overwriteFile INIT .f. - DATA docFileName - DATA cDocTitle - DATA cDocSubject - DATA cDocAuthor - DATA cDocCreated - DATA cDocManager - DATA cDocCompany + DATA docFileName + DATA cDocTitle + DATA cDocSubject + DATA cDocAuthor + DATA cDocCreated + DATA cDocManager + DATA cDocCompany DATA cDocVersion INIT "11.9999" DATA cError INIT "" DATA errors INIT .f. - + METHOD New( fileName ) - METHOD setOverwriteFile( overwrite ) - METHOD showErrorSheet( show ) - METHOD addError( cFunction, cMessage ) - METHOD getDefaultStyle() - METHOD addStyle( id ) - METHOD addSheet( id ) - METHOD checkSheetID( id ) - METHOD checkStyleID( id ) + METHOD setOverwriteFile( overwrite ) + METHOD showErrorSheet( show ) + METHOD addError( cFunction, cMessage ) + METHOD getDefaultStyle() + METHOD addStyle( id ) + METHOD addSheet( id ) + METHOD checkSheetID( id ) + METHOD checkStyleID( id ) METHOD writeData( target ) - METHOD docTitle( title ) - METHOD docSubject( subject ) - METHOD docAuthor( author ) - METHOD docManager( manager ) - METHOD docCompany( company ) - - ENDCLASS + METHOD docTitle( title ) + METHOD docSubject( subject ) + METHOD docAuthor( author ) + METHOD docManager( manager ) + METHOD docCompany( company ) + + ENDCLASS /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML:new( fileName ) LOCAL style - + style := ::addStyle( 'DEFAULT' ) style:name( 'Normal' ) style:alignVertical( 'Bottom' ) - + IF empty( fileName ) fileName := 'file.xml' ENDIF - + ::docFileName := fileName ::cDocCreated := DTOS( DATE() ) + 'T' + TIME() + 'Z' - + RETURN SELF /*----------------------------------------------------------------------*/ @@ -122,92 +122,92 @@ METHOD ExcelWriterXML:setOverwriteFile( overwrite ) ELSE ::overwriteFile := overwrite ENDIF - + RETURN NIL /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML:showErrorSheet( show ) IF ! ( VALTYPE( show ) == "L" ) ::lShowErrorSheet := .t. ELSE ::lShowErrorSheet := show - ENDIF - + ENDIF + RETURN NIL /*----------------------------------------------------------------------*/ METHOD ExcelWriterXML:addError( cFunction, cMessage ) LOCAL tmp - + tmp := { 'FUNCTION' => cFunction,; 'MESSAGE' => cMessage } - + ::formatErrors += tmp - + RETURN NIL - + /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML:getDefaultStyle() RETURN ::styles[ 1 ] /*----------------------------------------------------------------------*/ - -METHOD ExcelWriterXML:addStyle( id ) + +METHOD ExcelWriterXML:addStyle( id ) LOCAL style STATIC styleNum := 1 - + IF alltrim( id ) == '' id := NIL ENDIF - + IF id == NIL id := 'CustomStyle' + ALLTRIM( STR( styleNum, 3 ) ) styleNum++ ENDIF - + WHILE ! ::checkStyleID( id ) id := 'CustomStyle' + ALLTRIM( STR( styleNum, 3 ) ) styleNum++ ENDDO - + style := ExcelWriterXML_Style():new( id ) AADD( ::styles, style ) - + RETURN style - + /*----------------------------------------------------------------------*/ - -METHOD ExcelWriterXML:addSheet( id ) + +METHOD ExcelWriterXML:addSheet( id ) LOCAL sheet - + STATIC sheetNum:= 1 - + IF id == NIL id := 'Sheet' + ALLTRIM( STR( sheetNum, 3 ) ) sheetNum++ ENDIF - + WHILE ! ::checkSheetID( id ) id := 'Sheet' + ALLTRIM( STR( sheetNum, 3 ) ) sheetNum++ ENDDO - - sheet := ExcelWriterXML_Sheet():New( id ) + + sheet := ExcelWriterXML_Sheet():New( id ) AADD( ::sheets, sheet ) - - RETURN sheet + + RETURN sheet /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML:checkSheetID( id ) LOCAL sheet - + IF len( ::sheets ) > 0 FOR EACH sheet IN ::sheets IF id == sheet:getID() @@ -217,16 +217,16 @@ METHOD ExcelWriterXML:checkSheetID( id ) ELSE RETURN .t. ENDIF - + RETURN .t. /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML:checkStyleID( id ) LOCAL style - + IF LEN( ::styles ) > 0 - FOR EACH style IN ::styles + FOR EACH style IN ::styles IF id == style:getID() RETURN .f. ENDIF @@ -234,27 +234,27 @@ METHOD ExcelWriterXML:checkStyleID( id ) ELSE RETURN .t. ENDIF - + RETURN .t. /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML:writeData( target ) LOCAL style, sheet, xml := "", handle, fileExists, format - + LOCAL docTitle := '' LOCAL docSubject := '' LOCAL docAuthor := '' LOCAL docCreated := '' LOCAL docManager := '' LOCAL docCompany := '' - + IF target == NIL ::cError := "Target filename missing!" ::errors := .t. RETURN .t. - ENDIF - + ENDIF + fileExists := hb_fileExists( target ) IF ( fileExists == .t. .AND. ::overwriteFile == .f. ) ::cError := target + " exists and overwriteFile is set to false" @@ -267,29 +267,29 @@ METHOD ExcelWriterXML:writeData( target ) ::errors := .t. RETURN .f. ENDIF - + IF ::lShowErrorSheet == .t. format := ::addStyle( "formatErrorsHeader" ) format:setFontBold() format:bgColor( "red" ) ENDIF - + IF ! empty( ::cDocTitle ); docTitle := "" + OemToHtmlEspecial( ::cDocTitle ) + "" + HB_OsNewLine(); ENDIF IF ! empty( ::cDocSubject ); docSubject := "" + OemToHtmlEspecial( ::cDocSubject ) + "" + HB_OsNewLine(); ENDIF IF ! empty( ::cDocAuthor ); docAuthor := "" + OemToHtmlEspecial( ::cDocAuthor ) + "" + HB_OsNewLine(); ENDIF IF ! empty( ::cDocCreated ); docCreated := "" + OemToHtmlEspecial( ::cDocCreated ) + "" + HB_OsNewLine(); ENDIF IF ! empty( ::cDocManager ); docManager := "" + OemToHtmlEspecial( ::cDocManager ) + "" + HB_OsNewLine(); ENDIF IF ! empty( ::cDocCompany ); docCompany := "" + OemToHtmlEspecial( ::cDocCompany ) + "" + HB_OsNewLine(); ENDIF - - xml := '' + HB_OsNewLine() - xml += '' + HB_OsNewLine() - xml += ' 0 - FOR EACH sheet IN ::sheets + FOR EACH sheet IN ::sheets xml += sheet:getSheetXML( handle ) IF LEN( sheet:getErrors() ) > 0 ::errors := .t. @@ -326,106 +326,106 @@ METHOD ExcelWriterXML:writeData( target ) IF LEN( ::formatErrors ) > 0 ::errors := .t. ENDIF - + xml += '' - + fwrite( handle, xml ) xml := "" fclose( handle ) - + RETURN .t. - + /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML:docTitle( title ) IF HB_ISSTRING( title ) ::cDocTitle := title - ENDIF - + ENDIF + RETURN NIL /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML:docSubject( subject ) IF HB_ISSTRING( subject ) ::cDocSubject := subject - ENDIF - + ENDIF + RETURN NIL /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML:docAuthor( author ) - + IF HB_ISSTRING( author ) ::cDocAuthor := author - ENDIF - + ENDIF + RETURN NIL /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML:docManager( manager ) IF HB_ISSTRING( manager ) ::cDocManager := manager - ENDIF - + ENDIF + RETURN NIL /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML:docCompany( company ) IF HB_ISSTRING( company ) ::cDocCompany := company - ENDIF - + ENDIF + RETURN NIL /*----------------------------------------------------------------------*/ FUNCTION AnsiToHtml( x ) - RETURN( x ) + RETURN x /*----------------------------------------------------------------------*/ FUNCTION OEMTOHTML( xtxt ) LOCAL afrm, i, xret:= "", xpos - + afrm := {; - { "", "á" },; - { "", "â" },; - { "", "à" },; - { "", "ã" },; - { "", "ç" },; - { "", "é" },; - { "", "ê" },; - { "", "í" },; - { "", "ó" },; - { "", "ô" },; - { "", "õ" },; - { "", "ú" },; - { "", "ü" },; - { "", "Á" },; - { "", "Â" },; - { "", "À" },; - { "", "Ã" },; - { "", "Ç" },; - { "", "É" },; - { "", "Ê" },; - { "", "Í" },; - { "", "Ó" },; - { "", "Ô" },; - { "", "Õ" },; - { "", "Ú" },; - { "", "Ü" },; + { "", "á" },; + { "?", "â" },; + { "", "à" },; + { "", "ã" },; + { "+", "ç" },; + { "'", "é" },; + { "?", "ê" },; + { "", "í" },; + { "", "ó" },; + { """, "ô" },; + { "", "õ" },; + { "", "ú" },; + { "?", "ü" },; + { "u", "Á" },; + { "", "Â" },; + { "", "À" },; + { "", "Ã" },; + { "?", "Ç" },; + { "?", "É" },; + { "", "Ê" },; + { "", "Í" },; + { "", "Ó" },; + { "", "Ô" },; + { "", "Õ" },; + { "", "Ú" },; + { "", "Ü" },; { "-", "–" } ; } - + FOR i:= 1 TO LEN( xtxt ) IF( xpos:= ASCAN( afrm, {|x| SUBS( xtxt,i,1 ) == x[1] } ) ) > 0 xret+= afrm[xpos,2] @@ -433,23 +433,23 @@ FUNCTION OEMTOHTML( xtxt ) xret+= SUBS( xtxt,i,1 ) ENDIF NEXT - - RETURN( xret ) + + RETURN xret /*----------------------------------------------------------------------*/ FUNCTION OEMTOHTMLESPECIAL( xtxt ) LOCAL afrm, i, xret:= "", xpos - + xtxt := exretiraAcentos( xtxt ) afrm := {; - { '&', "&" },; - { '"', """ },; - { "'", "'" },; - { "<", "<" },; - { ">", ">" } ; + { '&', "&" },; + { '"', """ },; + { "'", "'" },; + { "<", "<" },; + { ">", ">" } ; } - + FOR i := 1 TO LEN( xtxt ) IF ( xpos := ASCAN( afrm, {|x| SUBSTR( xtxt, i, 1 ) == x[ 1 ] } ) ) > 0 xret += afrm[xpos,2] @@ -457,47 +457,47 @@ FUNCTION OEMTOHTMLESPECIAL( xtxt ) xret += SUBSTR( xtxt,i,1 ) ENDIF NEXT - + RETURN xret /*----------------------------------------------------------------------*/ FUNCTION EXRETIRAACENTOS( xtxt ) LOCAL afrm, i, xret:= "", xpos - + afrm := {; - { "", "a" },; - { "", "a" },; - { "", "a" },; - { "", "a" },; - { "", "c" },; - { "", "e" },; - { "", "e" },; - { "", "i" },; - { "", "o" },; - { "", "o" },; - { "", "o" },; - { "", "u" },; - { "", "u" },; - { "", "A" },; - { "", "A" },; - { "", "A" },; - { "", "A" },; - { "", "C" },; - { "", "E" },; - { "", "E" },; - { "", "I" },; - { "", "O" },; - { "", "O" },; - { "", "O" },; - { "", "U" },; - { "", "U" },; + { "", "a" },; + { "?", "a" },; + { "", "a" },; + { "", "a" },; + { "+", "c" },; + { "'", "e" },; + { "?", "e" },; + { "", "i" },; + { "", "o" },; + { """, "o" },; + { "", "o" },; + { "", "u" },; + { "?", "u" },; + { "u", "A" },; + { "", "A" },; + { "", "A" },; + { "", "A" },; + { "?", "C" },; + { "?", "E" },; + { "", "E" },; + { "", "I" },; + { "", "O" },; + { "", "O" },; + { "", "O" },; + { "", "U" },; + { "", "U" },; { CHR( 166 ), "." },; - { CHR( 167 ), "." },; - { CHR( 248 ), "." },; + { CHR( 167 ), "." },; + { CHR( 248 ), "." },; { CHR( 141 ), "" } ; } - + FOR i := 1 TO LEN( xtxt ) IF ( xpos:= ASCAN( afrm, { |x| SUBSTR( xtxt, i, 1 ) == x[ 1 ] } ) ) > 0 xret += afrm[ xpos, 2 ] @@ -505,7 +505,7 @@ FUNCTION EXRETIRAACENTOS( xtxt ) xret += SUBSTR( xtxt, i, 1 ) ENDIF NEXT - + RETURN xret /*----------------------------------------------------------------------*/ diff --git a/harbour/examples/hbxlsxml/xlsxml_y.prg b/harbour/examples/hbxlsxml/xlsxml_y.prg index dca9bbd5d9..46848285f1 100644 --- a/harbour/examples/hbxlsxml/xlsxml_y.prg +++ b/harbour/examples/hbxlsxml/xlsxml_y.prg @@ -1,7 +1,7 @@ /* * $Id$ */ - + /* * Harbour Project source code: * @@ -9,7 +9,7 @@ * www - http://www.xharbour.org http://harbour-project.org * * Thanks TO Robert F Greer, PHP original version - * http://sourceforge.net/projects/excelwriterxml/ + * http://sourceforge.net/projects/excelwriterxml/ * * This program is free software; you can redistribute it AND/OR modify * it under the terms of the GNU General PUBLIC License as published by @@ -52,12 +52,12 @@ * */ /*----------------------------------------------------------------------*/ - + #include "hbclass.ch" /*----------------------------------------------------------------------*/ -CREATE CLASS ExcelWriterXML_Style +CREATE CLASS ExcelWriterXML_Style DATA id DATA name @@ -65,14 +65,14 @@ CREATE CLASS ExcelWriterXML_Style DATA useFont INIT .f. DATA useBorder INIT .f. DATA useInterior INIT .f. - - DATA valign - DATA halign - DATA rotate + + DATA valign + DATA halign + DATA rotate DATA shrinktofit INIT 0 DATA verticaltext INIT 0 DATA wraptext INIT 0 - + DATA fontColor INIT 'Automatic' DATA fontName DATA fontFamily @@ -83,76 +83,76 @@ CREATE CLASS ExcelWriterXML_Style DATA strikethrough DATA shadow DATA outline - + DATA borderTop INIT {=>} DATA borderBottom INIT {=>} DATA borderLeft INIT {=>} DATA borderRight INIT {=>} DATA borderDL INIT {=>} DATA borderDR INIT {=>} - + DATA interiorColor DATA interiorPattern DATA interiorPatternColor - + DATA numberFormat - + DATA formatErrors INIT {=>} DATA namedColorsIE INIT {=>} - - METHOD new( id ) - METHOD getID() - METHOD getStyleXML() - METHOD checkColor( color ) - METHOD setName( name ) + + METHOD new( id ) + METHOD getID() + METHOD getStyleXML() + METHOD checkColor( color ) + METHOD setName( name ) METHOD alignVertical( valign ) - METHOD alignHorizontal( halign ) - METHOD alignRotate( rotate ) - METHOD alignShrinktofit() - METHOD alignVerticaltext() - METHOD alignWraptext() - METHOD setFontSize( fontSize ) - METHOD setFontColor( fontColor ) - METHOD setFontName( fontName ) - METHOD setFontFamily( fontFamily ) - METHOD setFontBold() - METHOD setFontItalic() - METHOD setFontStrikethrough() - METHOD setFontUnderline( uStyle ) - METHOD setFontShadow() - METHOD setFontOutline() - METHOD border( position, weight, color, linestyle ) - METHOD bgColor( color, pattern, patternColor ) - METHOD bgPattern( pattern, color ) - METHOD bgPatternColor( color ) - METHOD setNumberFormat( formatString ) - METHOD setNumberFormatDate() - METHOD setNumberFormatTime() - METHOD setNumberFormatDatetime() - - ENDCLASS - + METHOD alignHorizontal( halign ) + METHOD alignRotate( rotate ) + METHOD alignShrinktofit() + METHOD alignVerticaltext() + METHOD alignWraptext() + METHOD setFontSize( fontSize ) + METHOD setFontColor( fontColor ) + METHOD setFontName( fontName ) + METHOD setFontFamily( fontFamily ) + METHOD setFontBold() + METHOD setFontItalic() + METHOD setFontStrikethrough() + METHOD setFontUnderline( uStyle ) + METHOD setFontShadow() + METHOD setFontOutline() + METHOD border( position, weight, color, linestyle ) + METHOD bgColor( color, pattern, patternColor ) + METHOD bgPattern( pattern, color ) + METHOD bgPatternColor( color ) + METHOD setNumberFormat( formatString ) + METHOD setNumberFormatDate() + METHOD setNumberFormatTime() + METHOD setNumberFormatDatetime() + + ENDCLASS + /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML_Style:New( id ) - ::id:= id + ::id:= id ::namedColorsIE := getColorIE() - + RETURN SELF - + /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML_Style:getID() RETURN ::id - + /*----------------------------------------------------------------------*/ -METHOD ExcelWriterXML_Style:getStyleXML() +METHOD ExcelWriterXML_Style:getStyleXML() LOCAL fontcolor, positions, position, auxdata, pData, bLinestyle, bColor, bWeight, xml LOCAL numberFormat - + LOCAL name := '' LOCAL valign := '' LOCAL halign := '' @@ -160,7 +160,7 @@ METHOD ExcelWriterXML_Style:getStyleXML() LOCAL shrinktofit := '' LOCAL verticaltext := '' LOCAL wraptext := '' - + LOCAL bold := '' LOCAL italic := '' LOCAL strikethrough := '' @@ -170,18 +170,18 @@ METHOD ExcelWriterXML_Style:getStyleXML() LOCAL fontName := '' LOCAL fontFamily := '' LOCAL fontSize := '' - + LOCAL borders := '' - + LOCAL interior := '' LOCAL interiorColor := '' LOCAL interiorPattern := '' LOCAL interiorPatternColor := '' - - IF ! empty( ::name ) + + IF ! empty( ::name ) name := 'ss:Name="'+::name+'"' ENDIF - + IF ::useAlignment IF ! empty( ::valign ) valign := 'ss:Vertical="' + ::valign + '"' @@ -192,51 +192,51 @@ METHOD ExcelWriterXML_Style:getStyleXML() IF ! empty( ::rotate ) rotate := 'ss:Rotate="' + ::rotate + '"' ENDIF - IF ! empty( ::shrinktofit ) + IF ! empty( ::shrinktofit ) shrinktofit := 'ss:ShrinkToFit="1"' ENDIF - IF ! empty( ::verticaltext ) + IF ! empty( ::verticaltext ) verticaltext := 'ss:VerticalText="1"' ENDIF IF ! empty( ::wraptext ) wraptext := 'ss:WrapText="1"' ENDIF ENDIF - + IF( ::useFont ) - IF ! empty( ::fontColor ) + IF ! empty( ::fontColor ) fontColor := 'ss:Color="' + ::fontColor + '"' ENDIF - IF ! empty( ::bold ) + IF ! empty( ::bold ) bold := 'ss:Bold="1"' ENDIF - IF ! empty( ::italic ) + IF ! empty( ::italic ) italic := 'ss:Italic="1"' ENDIF - IF ! empty( ::strikethrough ) + IF ! empty( ::strikethrough ) strikethrough := 'ss:StrikeThrough="' + ::strikethrough + '"' ENDIF - IF ! empty( ::underline ) + IF ! empty( ::underline ) underline := 'ss:Underline="' + ::underline + '"' ENDIF - IF ! empty( ::outline ) + IF ! empty( ::outline ) outline := 'ss:Outline="1"' ENDIF - IF ! empty( ::shadow ) + IF ! empty( ::shadow ) shadow := 'ss:Shadow="1"' ENDIF - IF ! empty( ::fontName ) + IF ! empty( ::fontName ) fontName := 'ss:FontName="' + ::fontName + '"' ENDIF - IF ! empty( ::fontFamily ) + IF ! empty( ::fontFamily ) fontFamily := 'x:Family="' + ::fontFamily + '"' ENDIF - IF ! empty( ::fontSize ) + IF ! empty( ::fontSize ) fontSize := 'ss:Size="' + ALLTRIM( STR( ::fontSize, 10 ) ) + '"' ENDIF ENDIF - - IF ::useBorder + + IF ::useBorder borders := ' '+HB_OsNewLine() positions := { ; 'Top' => ::borderTop, ; @@ -265,12 +265,12 @@ METHOD ExcelWriterXML_Style:getStyleXML() NEXT borders += '' + HB_OsNewLine() ENDIF - + IF ::useInterior IF ! empty( ::interiorColor ) interiorColor := 'ss:Color="' + ::interiorColor + '"' ENDIF - IF ! empty( ::interiorPattern ) + IF ! empty( ::interiorPattern ) interiorPattern := 'ss:Pattern="' + ::interiorPattern + '"' ENDIF IF ! empty( ::interiorPatternColor ) @@ -278,15 +278,15 @@ METHOD ExcelWriterXML_Style:getStyleXML() ENDIF interior := ' ' + HB_OsNewLine() ENDIF - + IF ! empty( ::numberFormat ) numberFormat := ' ' + HB_OsNewLine() - ELSE + ELSE numberFormat := ' ' + HB_OsNewLine() ENDIF - + xml := ' '+HB_OsNewLine() - - RETURN( xml ) - + + RETURN xml + /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML_Style:checkColor( color ) IF LEFT( color, 1 ) == "#" @@ -317,18 +317,18 @@ METHOD ExcelWriterXML_Style:checkColor( color ) RETURN '' ENDIF RETURN NIL - + /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML_Style:setName( name ) ::name := name - + RETURN NIL - + /*----------------------------------------------------------------------*/ - -METHOD ExcelWriterXML_Style:alignVertical( valign ) + +METHOD ExcelWriterXML_Style:alignVertical( valign ) IF ( valign != 'Automatic' .AND.; valign != 'Top' .AND.; @@ -338,9 +338,9 @@ METHOD ExcelWriterXML_Style:alignVertical( valign ) ENDIF ::valign := valign ::useAlignment := .t. - + RETURN NIL - + /*----------------------------------------------------------------------*/ METHOD ExcelWriterXML_Style:alignHorizontal( halign ) @@ -353,66 +353,66 @@ METHOD ExcelWriterXML_Style:alignHorizontal( halign ) ENDIF ::halign := halign ::useAlignment := .t. - + RETURN NIL /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML_Style:alignRotate( rotate ) IF !HB_ISNUMERIC( rotate ) RETURN NIL ENDIF - IF abs( rotate ) > 90 + IF abs( rotate ) > 90 rotate := rotate % 90 ENDIF ::rotate := ALLTRIM( STR( rotate, 3 ) ) ::useAlignment := .t. - + RETURN NIL - + /*----------------------------------------------------------------------*/ METHOD ExcelWriterXML_Style:alignShrinktofit() ::shrinktofit := 1 ::useAlignment := .t. - + RETURN NIL - + /*----------------------------------------------------------------------*/ METHOD ExcelWriterXML_Style:alignVerticaltext() ::verticaltext := 1 ::useAlignment := .t. - + RETURN NIL - + /*----------------------------------------------------------------------*/ METHOD ExcelWriterXML_Style:alignWraptext() ::wraptext := 1 ::useAlignment := .t. - + RETURN NIL - + /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML_Style:setFontSize( fontSize ) IF ! HB_ISNUMERIC( fontSize ) fontSize := 10 ENDIF - IF fontSize <= 0 + IF fontSize <= 0 fontSize := 10 ENDIF ::fontSize := fontSize ::useFont := .t. - + RETURN NIL - + /*----------------------------------------------------------------------*/ METHOD ExcelWriterXML_Style:setFontColor( fontColor ) @@ -423,9 +423,9 @@ METHOD ExcelWriterXML_Style:setFontColor( fontColor ) ENDIF ::fontColor := fontColor ::useFont := .t. - + RETURN NIL - + /*----------------------------------------------------------------------*/ METHOD ExcelWriterXML_Style:setFontName( fontName ) @@ -435,9 +435,9 @@ METHOD ExcelWriterXML_Style:setFontName( fontName ) ENDIF ::fontName := fontName ::useFont := .t. - + RETURN NIL - + /*----------------------------------------------------------------------*/ METHOD ExcelWriterXML_Style:setFontFamily( fontFamily ) @@ -445,7 +445,7 @@ METHOD ExcelWriterXML_Style:setFontFamily( fontFamily ) IF fontFamily == NIL fontFamily:= 'Swiss' ENDIF - + IF ( fontFamily != 'Automatic' .AND.; fontFamily != 'Decorative' .AND.; fontFamily != 'Modern' .AND.; @@ -456,63 +456,63 @@ METHOD ExcelWriterXML_Style:setFontFamily( fontFamily ) ENDIF ::fontFamily := fontFamily ::useFont := .t. - + RETURN NIL - + /*----------------------------------------------------------------------*/ -METHOD ExcelWriterXML_Style:setFontBold() +METHOD ExcelWriterXML_Style:setFontBold() ::bold := 1 ::useFont := .t. - + RETURN NIL - + /*----------------------------------------------------------------------*/ -METHOD ExcelWriterXML_Style:setFontItalic() +METHOD ExcelWriterXML_Style:setFontItalic() ::italic := 1 ::useFont := .t. - + RETURN NIL - + /*----------------------------------------------------------------------*/ -METHOD ExcelWriterXML_Style:setFontStrikethrough() +METHOD ExcelWriterXML_Style:setFontStrikethrough() ::strikethrough := 1 ::useFont := .t. - + RETURN NIL - + /*----------------------------------------------------------------------*/ -METHOD ExcelWriterXML_Style:setFontUnderline( uStyle ) +METHOD ExcelWriterXML_Style:setFontUnderline( uStyle ) - IF uStyle == NIL + IF uStyle == NIL uStyle := 'Single' - ENDIF + ENDIF IF ( uStyle != 'None' .AND.; uStyle != 'Single' .AND.; uStyle != 'Double' .AND.; uStyle != 'SingleAccounting' .AND.; uStyle != 'DoubleAccounting' ) - - RETURN NIL + + RETURN NIL ENDIF ::underline := uStyle ::useFont := .t. - + RETURN NIL - + /*----------------------------------------------------------------------*/ -METHOD ExcelWriterXML_Style:setFontShadow() +METHOD ExcelWriterXML_Style:setFontShadow() ::shadow := 1 ::useFont := .t. - + RETURN NIL /*----------------------------------------------------------------------*/ @@ -521,14 +521,14 @@ METHOD ExcelWriterXML_Style:setFontOutline() ::outline := 1 ::useFont := .t. - + RETURN NIL - + /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML_Style:border( position,weight,color,linestyle ) LOCAL tmp - + IF position == NIL position := 'All' // All, Left, Top, Right, Bottom, DiagonalLeft, DiagonalRight ENDIF @@ -541,7 +541,7 @@ METHOD ExcelWriterXML_Style:border( position,weight,color,linestyle ) IF linestyle == NIL linestyle := 'Continuous' // None, Continuous, Dash, Dot, DashDot, DashDotDot, SlantDashDot, Double ENDIF - + IF ( position != 'All' .AND.; position != 'Left' .AND.; position != 'Top' .AND.; @@ -549,23 +549,23 @@ METHOD ExcelWriterXML_Style:border( position,weight,color,linestyle ) position != 'Bottom' .AND.; position != 'DiagonalLeft' .AND.; position != 'DiagonalRight' ) - + position := 'All' ENDIF - - IF HB_ISNUMERIC( weight ) + + IF HB_ISNUMERIC( weight ) IF abs( weight ) > 3 weight := 3 ENDIF ELSE weight := 1 ENDIF - + color:= ::checkColor( color ) IF LEFT( color,1 ) != "#" color := 'Automatic' ENDIF - + IF ( linestyle != 'None' .AND.; linestyle != 'Continuous' .AND.; linestyle != 'Dash' .AND.; @@ -574,40 +574,40 @@ METHOD ExcelWriterXML_Style:border( position,weight,color,linestyle ) linestyle != 'DashDotDot' .AND.; linestyle != 'SlantDashDot' .AND.; linestyle != 'Double' ) - + linestyle:= 'Continuous' ENDIF - + tmp := { ; 'LineStyle' => linestyle,; 'Color' => color, ; 'Weight' => weight } - + IF position == 'Top' .OR. position == 'All' ::borderTop := tmp ENDIF IF position == 'Bottom' .OR. position == 'All' ::borderBottom := tmp ENDIF - IF position == 'Left' .OR. position == 'All' + IF position == 'Left' .OR. position == 'All' ::borderLeft := tmp ENDIF - IF position == 'Right' .OR. position == 'All' + IF position == 'Right' .OR. position == 'All' ::borderRight := tmp ENDIF - IF position == 'DiagonalLeft' + IF position == 'DiagonalLeft' ::borderDL := tmp ENDIF - IF position == 'DiagonalRight' + IF position == 'DiagonalRight' ::borderDR := tmp ENDIF - + ::useBorder := .t. - + RETURN NIL - + /*----------------------------------------------------------------------*/ - + METHOD ExcelWriterXML_Style:bgColor( color, pattern, patternColor ) IF color == NIL @@ -616,7 +616,7 @@ METHOD ExcelWriterXML_Style:bgColor( color, pattern, patternColor ) IF pattern == NIL pattern := 'Solid' ENDIF - + color := ::checkColor( color ) IF LEFT( color,1 ) != "#" color := 'Yellow' @@ -626,7 +626,7 @@ METHOD ExcelWriterXML_Style:bgColor( color, pattern, patternColor ) ::bgPattern( pattern, patternColor ) ENDIF ::useInterior:= .t. - + RETURN NIL /*----------------------------------------------------------------------*/ @@ -636,7 +636,7 @@ METHOD ExcelWriterXML_Style:bgPattern( pattern, color ) IF pattern == NIL pattern := 'None' ENDIF - + IF ( pattern != 'None' .AND.; pattern != 'Solid' .AND.; pattern != 'Gray75' .AND.; @@ -656,16 +656,16 @@ METHOD ExcelWriterXML_Style:bgPattern( pattern, color ) pattern != 'ThinDiagStripe' .AND.; pattern != 'ThinHorzCross' .AND.; pattern != 'ThinDiagCross' ) - + pattern:= 'None' ENDIF - + ::interiorPattern := pattern - IF color != NIL + IF color != NIL ::bgPatternColor( color ) ENDIF ::useInterior := .t. - + RETURN NIL /*----------------------------------------------------------------------*/ @@ -683,7 +683,7 @@ METHOD ExcelWriterXML_Style:bgPatternColor( color ) ENDIF ::interiorPatternColor := color ::useInterior := .t. - + RETURN NIL /*----------------------------------------------------------------------*/ @@ -691,7 +691,7 @@ METHOD ExcelWriterXML_Style:bgPatternColor( color ) METHOD ExcelWriterXML_Style:setNumberFormat( formatString ) ::numberFormat := formatString - + RETURN NIL /*----------------------------------------------------------------------*/ @@ -699,7 +699,7 @@ METHOD ExcelWriterXML_Style:setNumberFormat( formatString ) METHOD ExcelWriterXML_Style:setNumberFormatDate() ::setNumberFormat( 'mm/dd/yy' ) - + RETURN NIL /*----------------------------------------------------------------------*/ @@ -707,7 +707,7 @@ METHOD ExcelWriterXML_Style:setNumberFormatDate() METHOD ExcelWriterXML_Style:setNumberFormatTime() ::setNumberFormat( 'hh:mm:ss' ) - + RETURN NIL /*----------------------------------------------------------------------*/ @@ -715,14 +715,14 @@ METHOD ExcelWriterXML_Style:setNumberFormatTime() METHOD ExcelWriterXML_Style:setNumberFormatDatetime() ::setNumberFormat( 'mm/dd/yy\ hh:mm:ss' ) - + RETURN NIL - + /*----------------------------------------------------------------------*/ FUNCTION getColorIE() LOCAL hcolor:= { => } - + hcolor[ 'aliceblue' ] := '#F0F8FF' hcolor[ 'antiquewhite' ] := '#FAEBD7' hcolor[ 'aqua' ] := '#00FFFF' @@ -863,7 +863,7 @@ FUNCTION getColorIE() hcolor[ 'whitesmoke' ] := '#F5F5F5' hcolor[ 'yellow' ] := '#FFFF00' hcolor[ 'yellowgreen' ] := '#9ACD32' - + RETURN hcolor /*----------------------------------------------------------------------*/ diff --git a/harbour/examples/httpsrv/uhttpd.prg b/harbour/examples/httpsrv/uhttpd.prg index 9b0102f25e..7d1a3341cc 100644 --- a/harbour/examples/httpsrv/uhttpd.prg +++ b/harbour/examples/httpsrv/uhttpd.prg @@ -229,7 +229,7 @@ FUNCTION MAIN( ... ) SysSettings() - ErrorBlock( { | oError | uhttpd_DefError( oError ) } ) + ErrorBlock( {| oError | uhttpd_DefError( oError ) } ) // ----------------------- Parameters defaults ----------------------------- @@ -655,7 +655,7 @@ STATIC FUNCTION AcceptConnections() LOCAL pThread LOCAL lQuitRequest := .F. - ErrorBlock( { | oError | uhttpd_DefError( oError ) } ) + ErrorBlock( {| oError | uhttpd_DefError( oError ) } ) WriteToConsole( "Starting AcceptConnections()" ) @@ -811,7 +811,7 @@ STATIC FUNCTION ProcessConnection() hb_ToOutDebug( "nThreadId = %s\r\n", nThreadId ) #endif - ErrorBlock( { | oError | uhttpd_DefError( oError ) } ) + ErrorBlock( {| oError | uhttpd_DefError( oError ) } ) WriteToConsole( "Starting ProcessConnections() " + hb_CStr( nThreadID ) ) @@ -970,7 +970,7 @@ STATIC FUNCTION ServiceConnection() PRIVATE _SERVER, _GET, _POST, _COOKIE, _SESSION, _REQUEST, _HTTP_REQUEST, _HTTP_RESPONSE, m_cPost - ErrorBlock( { | oError | uhttpd_DefError( oError ) } ) + ErrorBlock( {| oError | uhttpd_DefError( oError ) } ) nThreadId := hb_threadID() diff --git a/harbour/tests/codebloc.prg b/harbour/tests/codebloc.prg index e35d19bf3f..c2f8763ea9 100644 --- a/harbour/tests/codebloc.prg +++ b/harbour/tests/codebloc.prg @@ -83,7 +83,7 @@ FUNCTION MyEval( bCodeBlock ) LOCAL D := "this is another variable" - RETURN( Eval( bCodeBlock, " from ", "MyEval Function" ) ) + RETURN Eval( bCodeBlock, " from ", "MyEval Function" ) PROCEDURE OtherTest( cblock ) @@ -110,7 +110,7 @@ FUNCTION DetachLocal( x, y ) LOCAL z := x + y LOCAL cb := {|| QOut( "z=x+y=" ), QOut( z ), QOut( "x*x=" ), QOut( x * x ), QOut( "x*x+z=" ), x * x + z } - RETURN( cb ) + RETURN cb PROCEDURE BugToFix() @@ -123,4 +123,4 @@ PROCEDURE BugToFix() FUNCTION RetBlock() - RETURN( {| x | x * x } ) + RETURN {| x | x * x } diff --git a/harbour/tests/langmsg.prg b/harbour/tests/langmsg.prg index b39207d953..bbc57aa43b 100644 --- a/harbour/tests/langmsg.prg +++ b/harbour/tests/langmsg.prg @@ -55,7 +55,7 @@ PROCEDURE Main( cLng ) ? "----------------" a := GET_IERR() FOR i := 1 TO Len( a ) - ? PadR( a[i,1], 15 ) + "|" + PadR( aInt[i,2], 30 ) + "|" + PadR( a[i,2], 32 ) + ? PadR( a[ i, 1 ], 15 ) + "|" + PadR( aInt[ i, 2 ], 30 ) + "|" + PadR( a[ i, 2 ], 32 ) NEXT ? Inkey( 0 ) @@ -84,33 +84,34 @@ FUNCTION GET_DAYS() LOCAL i, n, aDays[ 7 ], dt := Date() - for i := 1 TO 7 + FOR i := 1 TO 7 n := DOW( dt ) aDays[ n ] := CDOW( dt ) ++dt - next + NEXT - RETURN ( aDays ) + RETURN aDays FUNCTION GET_MONTHS() - LOCAL i, n, aMonths[12], dt := Date() + LOCAL i, n, aMonths[ 12 ], dt := Date() dt -= Day( dt ) - 1 - for i := 1 TO 12 + FOR i := 1 TO 12 n := Month( dt ) aMonths[ n ] := CMonth( dt ) dt += 31 dt -= Day( dt ) - 1 - next + NEXT - RETURN ( aMonths ) + RETURN aMonths FUNCTION GET_ERR() LOCAL aErr - aErr := { { "EG_ARG ", hb_langErrMsg( 1 ) }, ; + aErr := {; + { "EG_ARG ", hb_langErrMsg( 1 ) }, ; { "EG_BOUND ", hb_langErrMsg( 2 ) }, ; { "EG_STROVERFLOW ", hb_langErrMsg( 3 ) }, ; { "EG_NUMOVERFLOW ", hb_langErrMsg( 4 ) }, ; diff --git a/harbour/tests/memvar.prg b/harbour/tests/memvar.prg index a871b0a57f..bf2b185967 100644 --- a/harbour/tests/memvar.prg +++ b/harbour/tests/memvar.prg @@ -53,7 +53,7 @@ PROCEDURE Main() RETURN - ///////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////// PROCEDURE Test1() @@ -77,7 +77,7 @@ FUNCTION Scope( value ) Scope2() QOut( "in SCOPE=", memvar1 ) - RETURN( value ) + RETURN value PROCEDURE Scope2() @@ -111,7 +111,7 @@ FUNCTION Scope3( value ) Scope4() QOut( "in SCOPE=", memvar2 ) - RETURN( value ) + RETURN value PROCEDURE Scope4() @@ -121,7 +121,7 @@ PROCEDURE Scope4() RETURN - //////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// PROCEDURE Test3() @@ -145,7 +145,7 @@ FUNCTION Scope5( value ) Scope6() QOut( "in SCOPE=", memvar3 ) - RETURN( value ) + RETURN value PROCEDURE Scope6() @@ -155,7 +155,7 @@ PROCEDURE Scope6() RETURN - /////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////// PROCEDURE Test4() @@ -179,7 +179,7 @@ FUNCTION Scope7( value ) Scope8() QOut( "in SCOPE=", memvar4 ) - RETURN( value ) + RETURN value PROCEDURE Scope8() @@ -189,7 +189,7 @@ PROCEDURE Scope8() RETURN - /////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////// PROCEDURE TEST5() @@ -245,7 +245,7 @@ FUNCTION UseVar( value ) #endif QOut( "" ) - RETURN( value ) + RETURN value PROCEDURE UseRef( reference ) @@ -253,7 +253,7 @@ PROCEDURE UseRef( reference ) RETURN - ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////// PROCEDURE Test6() @@ -275,7 +275,7 @@ PROCEDURE DetachMemvar( cValue ) RETURN - //////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////// PROCEDURE Test7( ) @@ -289,7 +289,7 @@ PROCEDURE Test7( ) RETURN - ///////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////// PROCEDURE Test8() @@ -342,7 +342,7 @@ PROCEDURE UseParam() RETURN - ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////// PROCEDURE TEST9() diff --git a/harbour/tests/statics.prg b/harbour/tests/statics.prg index 607c420a5c..569f382271 100644 --- a/harbour/tests/statics.prg +++ b/harbour/tests/statics.prg @@ -63,4 +63,4 @@ FUNCTION DetachVar( xLocal ) STATIC xStatic := 100 - RETURN( {| x | ++xStatic, x + xStatic + xLocal } ) + RETURN {| x | ++xStatic, x + xStatic + xLocal } diff --git a/harbour/tests/testwarn.prg b/harbour/tests/testwarn.prg index 598f480789..ef9bbdea2c 100644 --- a/harbour/tests/testwarn.prg +++ b/harbour/tests/testwarn.prg @@ -157,7 +157,7 @@ FUNCTION Main2() n := Seconds() + 2 n := Int( seconds() + 2 ) - RETURN( NIL ) + RETURN NIL FUNCTION Main3() diff --git a/harbour/tests/tstmacro.prg b/harbour/tests/tstmacro.prg index 91f2e65ba9..4078f9b5c1 100644 --- a/harbour/tests/tstmacro.prg +++ b/harbour/tests/tstmacro.prg @@ -65,7 +65,7 @@ FUNCTION TValue ENDIF - RETURN( oClass:Instance() ) + RETURN oClass:Instance() STATIC FUNCTION New()