From 992016b359c3ba76e25b7a03f49663d7a35d92ea Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 16 Oct 2008 06:44:26 +0000 Subject: [PATCH] 2008-10-16 08:42 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * include/common.ch * contrib/hbziparc/hbziparc.prg * source/rtl/tclass.prg * source/rtl/hbini.prg * Minor formatting. (hb_Is*() -> hb_is*()) * contrib/hbct/ctrand.prg * contrib/hbct/numconv.prg * contrib/hbct/cttime.prg * contrib/hbct/showtime.prg * contrib/hbwhat/hbwhat.ch * utils/hbrun/hbrun.prg * source/debug/dbgtobj.prg * source/debug/dbgbrwsr.prg * source/debug/dbgthsh.prg * source/debug/dbgtarr.prg * source/rtl/alert.prg * source/rtl/tbrowse.prg % ValType() -> IS*() / hb_is*() * contrib/hbwhat/hbwhat.ch % Using common.ch instead of replicating logic. * Some formatting. * utils/hbtest/hbtest.prg * Minor formatting. --- harbour/ChangeLog | 28 ++++++++++++++++ harbour/contrib/hbct/ctrand.prg | 3 +- harbour/contrib/hbct/cttime.prg | 8 +++-- harbour/contrib/hbct/numconv.prg | 2 +- harbour/contrib/hbct/showtime.prg | 2 +- harbour/contrib/hbwhat/hbwhat.ch | 47 ++++++++++++--------------- harbour/contrib/hbziparc/hbziparc.prg | 16 ++++----- harbour/include/common.ch | 16 ++++----- harbour/source/debug/dbgbrwsr.prg | 2 +- harbour/source/debug/dbgtarr.prg | 4 +-- harbour/source/debug/dbgthsh.prg | 4 +-- harbour/source/debug/dbgtobj.prg | 4 +-- harbour/source/rtl/alert.prg | 12 +++---- harbour/source/rtl/hbini.prg | 4 +-- harbour/source/rtl/tbrowse.prg | 2 +- harbour/source/rtl/tclass.prg | 4 +-- harbour/utils/hbrun/hbrun.prg | 21 ++++++------ harbour/utils/hbtest/hbtest.prg | 8 ++--- 18 files changed, 106 insertions(+), 81 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index cf24e8a5e0..8a4818bc06 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,34 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-10-16 08:42 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * include/common.ch + * contrib/hbziparc/hbziparc.prg + * source/rtl/tclass.prg + * source/rtl/hbini.prg + * Minor formatting. (hb_Is*() -> hb_is*()) + + * contrib/hbct/ctrand.prg + * contrib/hbct/numconv.prg + * contrib/hbct/cttime.prg + * contrib/hbct/showtime.prg + * contrib/hbwhat/hbwhat.ch + * utils/hbrun/hbrun.prg + * source/debug/dbgtobj.prg + * source/debug/dbgbrwsr.prg + * source/debug/dbgthsh.prg + * source/debug/dbgtarr.prg + * source/rtl/alert.prg + * source/rtl/tbrowse.prg + % ValType() -> IS*() / hb_is*() + + * contrib/hbwhat/hbwhat.ch + % Using common.ch instead of replicating logic. + * Some formatting. + + * utils/hbtest/hbtest.prg + * Minor formatting. + 2008-10-16 08:10 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/hbwhat/wincore.prg ! One STATIC made THREAD STATIC. diff --git a/harbour/contrib/hbct/ctrand.prg b/harbour/contrib/hbct/ctrand.prg index 3e097669dc..db48b34e42 100644 --- a/harbour/contrib/hbct/ctrand.prg +++ b/harbour/contrib/hbct/ctrand.prg @@ -1,6 +1,7 @@ /* * $Id$ */ + /* * Harbour Project source code: * CT3 functions: RANDOM(), RAND() @@ -52,7 +53,7 @@ #include "common.ch" FUNCTION Random( lMode ) -RETURN IIF( VALTYPE( lMode ) == "L" .AND. lMode, ; +RETURN IIF( ISLOGICAL( lMode ) .AND. lMode, ; HB_RandomInt( -32768, 32767 ), HB_RandomInt( 0, 65535 ) ) FUNCTION Rand( nStart ) diff --git a/harbour/contrib/hbct/cttime.prg b/harbour/contrib/hbct/cttime.prg index 7b805c64dc..cbda9a98b3 100644 --- a/harbour/contrib/hbct/cttime.prg +++ b/harbour/contrib/hbct/cttime.prg @@ -51,11 +51,13 @@ * */ +#include "common.ch" + function TIMETOSEC( cTime ) local nSec := 0, nLen, i, aLim, aMod, nInd, n if cTime == NIL nSec := seconds() -elseif valtype( cTime ) == "C" +elseif ISCHARACTER( cTime ) nLen := len( cTime ) if ( nLen + 1 ) % 3 == 0 .and. nLen <= 11 nInd := 1 @@ -80,8 +82,8 @@ return round( nSec, 2) /* round FL val to be sure that you can compare it */ function SECTOTIME( nSec, lHundr ) local i, h, n -n := iif( !valtype( nSec ) == "N", seconds(), nSec ) -if valtype( lHundr ) == "L" .and. lHundr +n := iif( !ISNUMBER( nSec ), seconds(), nSec ) +if ISLOGICAL( lHundr ) .and. lHundr h := ":" + strzero( ( nSec * 100 ) % 100, 2 ) else h := "" diff --git a/harbour/contrib/hbct/numconv.prg b/harbour/contrib/hbct/numconv.prg index 9d3bb79f37..b2da2456a6 100644 --- a/harbour/contrib/hbct/numconv.prg +++ b/harbour/contrib/hbct/numconv.prg @@ -88,7 +88,7 @@ LOCAL cNum Default cPad to " " Default nBase to 10 -IF VALTYPE( xNum ) == "C" +IF ISCHARACTER( xNum ) xNum := UPPER( ALLTRIM( xNum ) ) xNum := CTON( xNum, 16 ) ENDIF diff --git a/harbour/contrib/hbct/showtime.prg b/harbour/contrib/hbct/showtime.prg index 706c92bf35..29966099b7 100644 --- a/harbour/contrib/hbct/showtime.prg +++ b/harbour/contrib/hbct/showtime.prg @@ -54,7 +54,7 @@ FUNCTION SHOWTIME( nRow, nCol, lNoSec, cColor, l12, lAmPm ) STATIC s_hTimer := NIL - IF VALTYPE( nRow ) == "N" .AND. nRow >= 0 .AND. nRow <= MAXROW( .T. ) + IF ISNUMBER( nRow ) .AND. nRow >= 0 .AND. nRow <= MAXROW( .T. ) IF s_hTimer != NIL HB_IDLEDEL( s_hTimer ) ENDIF diff --git a/harbour/contrib/hbwhat/hbwhat.ch b/harbour/contrib/hbwhat/hbwhat.ch index f23f64da97..1dd097d404 100644 --- a/harbour/contrib/hbwhat/hbwhat.ch +++ b/harbour/contrib/hbwhat/hbwhat.ch @@ -2,6 +2,8 @@ * $Id$ */ +#include "common.ch" + #xCommand ? ? < x > = > OutputDebugString( asString( < x > ) ) #xCommand ? < x > = > OutputDebugString( asString( < x > ) + chr( 13 ) ) @@ -56,45 +58,36 @@ GET < Var > ; // Variable type identifier pseudo-functions //////////////////////////////////////////// -#translate ISNIL( ) => ( () == NIL ) -#translate ISARRAY( ) => ( VALTYPE( ) == "A" ) -#translate ISBLOCK( ) => ( VALTYPE( ) == "B" ) -#translate ISCHARACTER( ) => ( VALTYPE( ) == "C" ) -#translate ISCHAR( ) => ( VALTYPE( ) == "C" ) -#translate ISSTRING( ) => ( VALTYPE( ) == "C" ) -#translate ISDATE( ) => ( VALTYPE( ) == "D" ) -#translate ISLOGICAL( ) => ( VALTYPE( ) == "L" ) -#translate ISNUMBER( ) => ( VALTYPE( ) == "N" ) -#translate ISNUMERIC( ) => ( VALTYPE( ) == "N" ) -#translate ISOBJECT( ) => ( VALTYPE( ) == "O" ) +#translate ISCHAR( ) => ( hb_isString( ) ) +#translate ISSTRING( ) => ( hb_isString( ) ) +#translate ISNUMERIC( ) => ( hb_isNumeric( ) ) #translate IFNIL( ,, ) => IF( () == NIL,, ) -#translate IFARRAY( ,, ) => IF( VALTYPE( ) == "A",, ) -#translate IFBLOCK( ,, ) => IF( VALTYPE( ) == "B",, ) -#translate IFCHARACTER( ,, ) => IF( VALTYPE( ) == "C",, ) -#translate IFCHAR( ,, ) => IF( VALTYPE( ) == "C",, ) -#translate IFSTRING( ,, ) => IF( VALTYPE( ) == "C",, ) -#translate IFDATE( ,, ) => IF( VALTYPE( ) == "D",, ) -#translate IFLOGICAL( ,, ) => IF( VALTYPE( ) == "L",, ) -#translate IFNUMBER( ,, ) => IF( VALTYPE( ) == "N",, ) -#translate IFNUMERIC( ,, ) => IF( VALTYPE( ) == "N",, ) -#translate IFOBJECT( ,, ) => IF( VALTYPE( ) == "O",, ) -#translate IFEMPTY( ,, ) => IF( EMPTY( ),, ) - +#translate IFARRAY( ,, ) => IF( hb_isArray( ),, ) +#translate IFBLOCK( ,, ) => IF( hb_isBlock( ),, ) +#translate IFCHARACTER( ,, ) => IF( hb_isString( ),, ) +#translate IFCHAR( ,, ) => IF( hb_isString( ),, ) +#translate IFSTRING( ,, ) => IF( hb_isString( ),, ) +#translate IFDATE( ,, ) => IF( hb_isDate( ),, ) +#translate IFLOGICAL( ,, ) => IF( hb_isLogical( ),, ) +#translate IFNUMBER( ,, ) => IF( hb_isNumeric( ),, ) +#translate IFNUMERIC( ,, ) => IF( hb_isNumeric( ),, ) +#translate IFOBJECT( ,, ) => IF( hb_isObject( ),, ) +#translate IFEMPTY( ,, ) => IF( Empty( ),, ) ///////////////////////////////////// // Abbreviated flow control modifiers ///////////////////////////////////// -#xcommand BREAKIF => IF () ; BREAK ; END -#xcommand EXITIF => IF () ; EXIT ; END -#xcommand LOOPIF => IF () ; LOOP ; END +#xcommand BREAKIF => IF () ; BREAK ; ENDIF +#xcommand EXITIF => IF () ; EXIT ; ENDIF +#xcommand LOOPIF => IF () ; LOOP ; ENDIF // Extended commands #command UPDATE IF TO ; => ; - IF ; := ; END + IF ; := ; ENDIF #xtranslate frac() => (-int()) diff --git a/harbour/contrib/hbziparc/hbziparc.prg b/harbour/contrib/hbziparc/hbziparc.prg index bb6c172384..09330aae09 100644 --- a/harbour/contrib/hbziparc/hbziparc.prg +++ b/harbour/contrib/hbziparc/hbziparc.prg @@ -775,10 +775,10 @@ FUNCTION hb_ZipFile( cFileName,; DEFAULT lWithPath TO .F. DEFAULT lWithDrive TO .F. - IF hb_IsString( acFiles ) + IF hb_isString( acFiles ) acFiles := { acFiles } ENDIF - IF hb_IsString( acExclude ) + IF hb_isString( acExclude ) acExclude := { acExclude } ENDIF @@ -823,7 +823,7 @@ FUNCTION hb_ZipFile( cFileName,; IF ( hHandle := FOpen( cFileToZip, FO_READ ) ) != F_ERROR - IF hb_IsBlock( bUpdate ) + IF hb_isBlock( bUpdate ) Eval( bUpdate, cFileToZip, nPos++ ) ENDIF @@ -836,7 +836,7 @@ FUNCTION hb_ZipFile( cFileName,; DO WHILE ( nLen := FRead( hHandle, @cBuffer, Len( cBuffer ) ) ) > 0 - IF hb_IsBlock( bProgress ) + IF hb_isBlock( bProgress ) nRead += nLen Eval( bProgress, nRead, nSize ) ENDIF @@ -951,8 +951,8 @@ FUNCTION hb_UnzipFile( cFileName, bUpdate, lWithPath, cPassword, cPath, acFiles, IF !Empty( hUnzip := hb_UnzipOpen( cFileName ) ) - IF hb_IsNumeric( acFiles ) .OR. ; - hb_IsString( acFiles ) + IF hb_isNumeric( acFiles ) .OR. ; + hb_isString( acFiles ) acFiles := { acFiles } ENDIF @@ -972,7 +972,7 @@ FUNCTION hb_UnzipFile( cFileName, bUpdate, lWithPath, cPassword, cPath, acFiles, IF AScan( acFiles, nPos ) > 0 .OR. ; AScan( acFiles, {| cMask | hb_FileMatch( cZipName, cMask ) } ) > 0 - IF hb_IsBlock( bUpdate ) + IF hb_isBlock( bUpdate ) Eval( bUpdate, cZipName, nPos ) ENDIF @@ -1046,7 +1046,7 @@ FUNCTION hb_ZipDeleteFiles( cFileName, acFiles ) ENDIF ENDIF - IF hb_IsString( acFiles ) + IF hb_isString( acFiles ) acFiles := { acFiles } ENDIF diff --git a/harbour/include/common.ch b/harbour/include/common.ch index ea799e4fa0..5298c9d109 100644 --- a/harbour/include/common.ch +++ b/harbour/include/common.ch @@ -61,14 +61,14 @@ /* Type checking macros */ #translate ISNIL( ) => ( == NIL ) -#translate ISARRAY( ) => hb_IsArray( ) -#translate ISBLOCK( ) => hb_IsBlock( ) -#translate ISCHARACTER( ) => hb_IsString( ) -#translate ISDATE( ) => hb_IsDate( ) -#translate ISLOGICAL( ) => hb_IsLogical( ) -#translate ISMEMO( ) => hb_IsMemo( ) -#translate ISNUMBER( ) => hb_IsNumeric( ) -#translate ISOBJECT( ) => hb_IsObject( ) +#translate ISARRAY( ) => hb_isArray( ) +#translate ISBLOCK( ) => hb_isBlock( ) +#translate ISCHARACTER( ) => hb_isString( ) +#translate ISDATE( ) => hb_isDate( ) +#translate ISLOGICAL( ) => hb_isLogical( ) +#translate ISMEMO( ) => hb_isMemo( ) +#translate ISNUMBER( ) => hb_isNumeric( ) +#translate ISOBJECT( ) => hb_isObject( ) /* DEFAULT and UPDATE commands */ #xcommand DEFAULT TO [, TO ] => ; diff --git a/harbour/source/debug/dbgbrwsr.prg b/harbour/source/debug/dbgbrwsr.prg index b83f32922e..15d5a77edc 100644 --- a/harbour/source/debug/dbgbrwsr.prg +++ b/harbour/source/debug/dbgbrwsr.prg @@ -169,7 +169,7 @@ METHOD ForceStable() xData := Eval( oCol:block ) nClr := iif( nRow == ::rowPos, 2, 1 ) aClr := Eval( oCol:colorBlock, xData ) - IF VALTYPE( aClr ) == "A" + IF ISARRAY( aClr ) nClr := aClr[ nClr ] ELSE nClr := oCol:defColor[ nClr ] diff --git a/harbour/source/debug/dbgtarr.prg b/harbour/source/debug/dbgtarr.prg index dcc393e084..1c19466ea8 100644 --- a/harbour/source/debug/dbgtarr.prg +++ b/harbour/source/debug/dbgtarr.prg @@ -258,14 +258,14 @@ METHOD SetsKeyPressed( nKey, oBrwSets, oWnd, cName, aArray ) CLASS HBDbArray ::nCurWindow-- ENDIF ENDIF - ELSEIF ISBLOCK( aArray[ nSet ] ) .OR. Valtype( aArray[ nSet ] ) == "P" + ELSEIF ISBLOCK( aArray[ nSet ] ) .OR. hb_isPointer( aArray[ nSet ] ) __dbgAlert( "Value cannot be edited" ) ELSE IF ::lEditable oBrwSets:RefreshCurrent() IF ISOBJECT( aArray[ nSet ] ) __DbgObject( aArray[ nSet ], cName + "[" + LTrim( Str( nSet ) ) + "]" ) - ELSEIF ValType( aArray[ nSet ] ) == "H" + ELSEIF hb_isHash( aArray[ nSet ] ) __DbgHashes( aArray[ nSet ], cName + "[" + LTrim( Str( nSet ) ) + "]" ) ELSE ::doGet( oBrwsets, aArray, nSet ) diff --git a/harbour/source/debug/dbgthsh.prg b/harbour/source/debug/dbgthsh.prg index 3f6f2703b0..627be6d517 100644 --- a/harbour/source/debug/dbgthsh.prg +++ b/harbour/source/debug/dbgthsh.prg @@ -249,7 +249,7 @@ METHOD SetsKeyPressed( nKey, oBrwSets, oWnd, cName, hHash ) CLASS HBDbHash uValue := HB_HValueAt( hHash, nSet ) - IF ValType( uValue ) == "H" + IF hb_isHash( uValue ) IF Len( uValue ) == 0 __dbgAlert( "Hash is empty" ) @@ -269,7 +269,7 @@ METHOD SetsKeyPressed( nKey, oBrwSets, oWnd, cName, hHash ) CLASS HBDbHash ::nCurwindow-- ENDIF ENDIF - ELSEIF ISBLOCK( uValue ) .OR. ValType( uValue ) == "P" + ELSEIF ISBLOCK( uValue ) .OR. hb_isPointer( uValue ) __dbgAlert( "Value cannot be edited" ) ELSE IF ::lEditable diff --git a/harbour/source/debug/dbgtobj.prg b/harbour/source/debug/dbgtobj.prg index ad4c25a449..21caf6f755 100644 --- a/harbour/source/debug/dbgtobj.prg +++ b/harbour/source/debug/dbgtobj.prg @@ -307,7 +307,7 @@ METHOD SetsKeyPressed( nKey, oBrwSets, nSets, aArray ) CLASS HBDbObject IF Len( aArray[ nSet, 2 ] ) > 0 HBDbArray():New( aArray[ nSet, 2 ], ::pitems[ nSet, 1 ] ) ENDIF - ELSEIF ValType( aArray[ nSet, 2 ] ) == "H" + ELSEIF hb_isHash( aArray[ nSet, 2 ] ) IF Len( aArray[ nSet, 2 ] ) > 0 HBDbHash():New( aArray[ nSet, 2 ], ::pitems[ nSet, 1 ] ) ENDIF @@ -316,7 +316,7 @@ METHOD SetsKeyPressed( nKey, oBrwSets, nSets, aArray ) CLASS HBDbObject ELSEIF ( ISCHARACTER( aArray[ nSet, 2 ] ) .AND. ; !aArray[ nSet, 3 ] ) .OR. ; ISBLOCK( aArray[ nSet, 2 ] ) .OR. ; - ValType( aArray[ nSet, 2 ] ) == "P" + hb_isPointer( aArray[ nSet, 2 ] ) __dbgAlert( "Value cannot be edited" ) ELSE IF ::lEditable diff --git a/harbour/source/rtl/alert.prg b/harbour/source/rtl/alert.prg index 684360e8f7..726b5e7b64 100644 --- a/harbour/source/rtl/alert.prg +++ b/harbour/source/rtl/alert.prg @@ -87,12 +87,12 @@ FUNCTION Alert( xMessage, aOptions, cColorNorm, nDelay ) DO CASE CASE ValType( xMessage ) $ "CM" ; cMessage := StrTran( xMessage, ";", Chr( 10 ) ) - CASE ValType( xMessage ) == "N" ; cMessage := LTrim( Str( xMessage ) ) - CASE ValType( xMessage ) == "D" ; cMessage := DToC( xMessage ) - CASE ValType( xMessage ) == "L" ; cMessage := iif( xMessage, ".T.", ".F." ) - CASE ValType( xMessage ) == "O" ; cMessage := xMessage:className + " Object" - CASE ValType( xMessage ) == "S" ; cMessage := "@" + xMessage:Name + "()" - CASE ValType( xMessage ) == "B" ; cMessage := "{|| ... }" + CASE hb_IsNumeric( xMessage ) ; cMessage := LTrim( Str( xMessage ) ) + CASE hb_IsDate( xMessage ) ; cMessage := DToC( xMessage ) + CASE hb_IsLogical( xMessage ) ; cMessage := iif( xMessage, ".T.", ".F." ) + CASE hb_IsObject( xMessage ) ; cMessage := xMessage:className + " Object" + CASE hb_IsSymbol( xMessage ) ; cMessage := "@" + xMessage:Name + "()" + CASE hb_IsBlock( xMessage ) ; cMessage := "{|| ... }" OTHERWISE ; cMessage := "NIL" ENDCASE diff --git a/harbour/source/rtl/hbini.prg b/harbour/source/rtl/hbini.prg index e21369a298..0c273e4b55 100644 --- a/harbour/source/rtl/hbini.prg +++ b/harbour/source/rtl/hbini.prg @@ -299,7 +299,7 @@ FUNCTION hb_IniWrite( xFileName, hIni, cCommentBegin, cCommentEnd, lAutoMain ) ELSE /* When automain is off, just write all the toplevel variables. */ - hb_HEval( hIni, { |cKey, xVal| iif( ! hb_IsHash( xVal ),; + hb_HEval( hIni, { |cKey, xVal| iif( ! hb_isHash( xVal ),; FWrite( hFile, hb_CStr( cKey ) + " = " + ; hb_CStr( xVal ) + cNewLine ), /* nothing */ ) } ) ENDIF @@ -314,7 +314,7 @@ FUNCTION hb_IniWrite( xFileName, hIni, cCommentBegin, cCommentEnd, lAutoMain ) ENDIF ELSE /* When automain is off, skip all the toplevel variables. */ - IF ! hb_IsHash( cSection ) + IF ! hb_isHash( cSection ) LOOP ENDIF ENDIF diff --git a/harbour/source/rtl/tbrowse.prg b/harbour/source/rtl/tbrowse.prg index b21a549870..1dfd6f0a72 100644 --- a/harbour/source/rtl/tbrowse.prg +++ b/harbour/source/rtl/tbrowse.prg @@ -338,7 +338,7 @@ METHOD new( nTop, nLeft, nBottom, nRight ) CLASS TBROWSE STATIC FUNCTION _SKIP_RESULT( xResult ) - RETURN iif( ValType( xResult ) == "N", Int( xResult ), 0 ) + RETURN iif( ISNUMBER( xResult ), Int( xResult ), 0 ) STATIC PROCEDURE _DISP_FHSEP( nRow, nType, cColor, aColData ) diff --git a/harbour/source/rtl/tclass.prg b/harbour/source/rtl/tclass.prg index af0f8bceac..3990e7a363 100644 --- a/harbour/source/rtl/tclass.prg +++ b/harbour/source/rtl/tclass.prg @@ -172,7 +172,7 @@ STATIC FUNCTION New( cClassName, xSuper, sClassFunc, lModuleFriendly ) ::asSuper := {} ELSEIF ISCHARACTER( xSuper ) ::asSuper := { __DynsN2Sym( xSuper ) } - ELSEIF hb_IsSymbol( xSuper ) + ELSEIF hb_isSymbol( xSuper ) ::asSuper := { xSuper } ELSEIF ISARRAY( xSuper ) ::asSuper := {} @@ -181,7 +181,7 @@ STATIC FUNCTION New( cClassName, xSuper, sClassFunc, lModuleFriendly ) IF !Empty( xSuper[ i ] ) IF ISCHARACTER( xSuper[ i ] ) AAdd( ::asSuper, __DynsN2Sym( xSuper[ i ] ) ) - ELSEIF hb_IsSymbol( xSuper[ i ] ) + ELSEIF hb_isSymbol( xSuper[ i ] ) AAdd( ::asSuper, xSuper[ i ] ) ENDIF ENDIF diff --git a/harbour/utils/hbrun/hbrun.prg b/harbour/utils/hbrun/hbrun.prg index 447a9751f2..4f37ea08bd 100644 --- a/harbour/utils/hbrun/hbrun.prg +++ b/harbour/utils/hbrun/hbrun.prg @@ -50,6 +50,7 @@ * */ +#include "common.ch" #include "inkey.ch" #include "setcurs.ch" @@ -192,19 +193,19 @@ PROCEDURE _APPMAIN( cFile, ... ) ENDDO ENDIF -RETURN + RETURN /* ********************************************************************** */ STATIC PROCEDURE HB_DotUsage() OutStd( 'Harbour "DOt Prompt" Console / runner ' + HBRawVersion() + HB_OSNewLine() +; - 'Copyright (c) 1999-2008, Przemyslaw Czerpak' + HB_OSNewLine() + ; - 'http://www.harbour-project.org/' + HB_OSNewLine() +; + "Copyright (c) 1999-2008, Przemyslaw Czerpak" + HB_OSNewLine() + ; + "http://www.harbour-project.org/" + HB_OSNewLine() +; HB_OSNewLine() +; - 'Syntax: hbrun [ []]' + HB_OSNewLine() ) + "Syntax: hbrun [ []]" + HB_OSNewLine() ) -RETURN + RETURN /* ********************************************************************** */ @@ -235,7 +236,7 @@ STATIC PROCEDURE HB_DotInfo( cCommand ) ENDIF SetPos( r, c ) -RETURN + RETURN /* ********************************************************************** */ @@ -246,16 +247,16 @@ STATIC PROCEDURE HB_DotErr( oErr, cCommand ) cMessage := "Sorry, could not execute:;;" + cCommand + ";;" IF oErr:ClassName == "ERROR" cMessage += oErr:Description - IF ValType( oErr:Args ) == 'A' .AND. Len( oErr:Args ) > 0 + IF ISARRAY( oErr:Args ) .AND. Len( oErr:Args ) > 0 cMessage += ";Arguments:" FOR EACH xArg IN oErr:Args cMessage += ";" + HB_CStr( xArg ) NEXT ENDIF - ELSEIF ValType( oErr ) == 'C' + ELSEIF ISCHARACTER( oErr ) cMessage += oErr ENDIF - cMessage += ";;" + ProcName( 2 ) + '(' + LTrim( Str( ProcLine( 2 ) ) ) + ')' + cMessage += ";;" + ProcName( 2 ) + "(" + LTrim( Str( ProcLine( 2 ) ) ) + ")" Alert( cMessage ) @@ -296,7 +297,7 @@ STATIC PROCEDURE HB_DotExec( cCommand ) __MVSETBASE() -RETURN + RETURN STATIC FUNCTION HBRawVersion() RETURN StrTran( Version(), "Harbour ", "" ) diff --git a/harbour/utils/hbtest/hbtest.prg b/harbour/utils/hbtest/hbtest.prg index 0f791a0a39..93be5bb7ac 100644 --- a/harbour/utils/hbtest/hbtest.prg +++ b/harbour/utils/hbtest/hbtest.prg @@ -330,11 +330,11 @@ PROCEDURE TEST_CALL( cBlock, bBlock, xResultExpected ) s_nCount++ - IF !( ValType( cBlock ) == "C" ) + IF ValType( cBlock ) == "C" + lPPError := .F. + ELSE cBlock := "!! Preprocessor error !!" lPPError := .T. - ELSE - lPPError := .F. ENDIF lSkipped := AScan( s_aSkipList, s_nCount ) > 0 @@ -357,7 +357,7 @@ PROCEDURE TEST_CALL( cBlock, bBlock, xResultExpected ) ErrorBlock( bOldError ) IF !( ValType( xResult ) == ValType( xResultExpected ) ) - IF ValType( xResultExpected) == "C" .AND. ValType( xResult ) $ "ABMO" + IF ValType( xResultExpected ) == "C" .AND. ValType( xResult ) $ "ABMO" lFailed := !( XToStr( xResult ) == xResultExpected ) ELSE lFailed := .T.