2012-11-26 18:51 UTC+0100 Viktor Szakats (harbour syenar.net)

* contrib/hbhttpd/widgets.prg
  * contrib/hbtip/client.prg
    + support function pointers where codeblocks are accepted

  * contrib/hbnf/ontick.prg
    + FT_ONIDLE(): support Harbour function pointers as Harbour extension

  * contrib/xhb/xhberr.prg
    % Use DO() instead of EVAL( __DYNSN2SYM() ) thus avoiding
      internal core functions.
This commit is contained in:
Viktor Szakats
2012-11-26 17:54:13 +00:00
parent 52bef1c5b8
commit c4957bf854
5 changed files with 35 additions and 21 deletions

View File

@@ -10,6 +10,18 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2012-11-26 18:51 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbhttpd/widgets.prg
* contrib/hbtip/client.prg
+ support function pointers where codeblocks are accepted
* contrib/hbnf/ontick.prg
+ FT_ONIDLE(): support Harbour function pointers as Harbour extension
* contrib/xhb/xhberr.prg
% Use DO() instead of EVAL( __DYNSN2SYM() ) thus avoiding
internal core functions.
2012-11-26 15:25 UTC+0100 Viktor Szakats (harbour syenar.net)
* src/rtl/dbedit.prg
+ also accept function pointers as user functions

View File

@@ -382,7 +382,7 @@ METHOD Output() CLASS UWBrowse
xField := Self:aColumns[ nI, 3 ]
IF HB_ISSTRING( xField )
xI := FieldGet( FieldPos( xField ) )
ELSEIF HB_ISBLOCK( xField )
ELSEIF HB_ISEVALITEM( xField )
xI := Eval( xField )
ENDIF
SWITCH ValType( xI )

View File

@@ -66,7 +66,8 @@ STATIC PROCEDURE __ft_OnTick()
PROCEDURE ft_OnTick( bOnTick, nTickInterval )
IF HB_ISBLOCK( bOnTick )
/* Harbour extension: Harbour will also accept function pointers */
IF HB_ISEVALITEM( bOnTick )
t_bOnTick := bOnTick
IF HB_ISNUMERIC( nTickInterval )
t_nTickInterval := ( 1 / 18.20648 ) * nTickInterval * 1000

View File

@@ -194,7 +194,7 @@ METHOD New( oUrl, xTrace, oCredentials ) CLASS TIPClient
( HB_ISLOGICAL( xTrace ) .AND. xTrace )
oLog := TIPLog():New( iif( HB_ISSTRING( xTrace ), xTrace, NIL ) )
::bTrace := {| cMsg | iif( PCount() > 0, oLog:Add( cMsg ), oLog:Close() ) }
ELSEIF HB_ISBLOCK( xTrace )
ELSEIF HB_ISEVALITEM( xTrace )
::bTrace := xTrace
ENDIF
@@ -382,7 +382,7 @@ METHOD Close() CLASS TIPClient
::isOpen := .F.
ENDIF
IF HB_ISBLOCK( ::bTrace )
IF HB_ISEVALITEM( ::bTrace )
/* Call with no parameter to signal end of logging session */
Eval( ::bTrace )
ENDIF
@@ -560,9 +560,9 @@ METHOD WriteFromFile( cFile ) CLASS TIPClient
RETURN .T.
/*
HZ: METHOD :getOk() is not declared in TIPClient
#if 0
/* HZ: METHOD :getOk() is not declared in TIPClient */
METHOD Data( cData ) CLASS TIPClient
::InetSendall( ::SocketCon, "DATA" + ::cCRLF )
IF ! ::GetOk()
@@ -570,7 +570,8 @@ METHOD Data( cData ) CLASS TIPClient
ENDIF
::InetSendall(::SocketCon, cData + ::cCRLF + "." + ::cCRLF )
RETURN ::GetOk()
*/
#endif
METHOD Write( cData, nLen, bCommit ) CLASS TIPClient
@@ -610,7 +611,7 @@ METHOD inetSendAll( SocketCon, cData, nLen ) CLASS TIPClient
nRet := hb_inetSendAll( SocketCon, cData, nLen )
ENDIF
IF HB_ISBLOCK( ::bTrace )
IF HB_ISEVALITEM( ::bTrace )
::Log( SocketCon, nlen, cData, nRet )
ENDIF
@@ -620,7 +621,7 @@ METHOD inetCount( SocketCon ) CLASS TIPClient
LOCAL nRet := hb_inetCount( SocketCon )
IF HB_ISBLOCK( ::bTrace )
IF HB_ISEVALITEM( ::bTrace )
::Log( SocketCon, nRet )
ENDIF
@@ -644,7 +645,7 @@ METHOD inetRecv( SocketCon, cStr1, len ) CLASS TIPClient
nRet := hb_inetRecv( SocketCon, @cStr1, len )
ENDIF
IF HB_ISBLOCK( ::bTrace )
IF HB_ISEVALITEM( ::bTrace )
::Log( SocketCon, "", len, iif( nRet >= 0, cStr1, nRet ) )
ENDIF
@@ -672,7 +673,7 @@ METHOD inetRecvLine( SocketCon, nRet, size ) CLASS TIPClient
cRet := hb_inetRecvLine( SocketCon, @nRet, size )
ENDIF
IF HB_ISBLOCK( ::bTrace )
IF HB_ISEVALITEM( ::bTrace )
::Log( SocketCon, "", size, cRet )
ENDIF
@@ -700,7 +701,7 @@ METHOD inetRecvAll( SocketCon, cRet, size ) CLASS TIPClient
nRet := hb_inetRecvAll( SocketCon, @cRet, size )
ENDIF
IF HB_ISBLOCK( ::bTrace )
IF HB_ISEVALITEM( ::bTrace )
::Log( SocketCon, "", size, iif( nRet >= 0, cRet, nRet ) )
ENDIF
@@ -722,7 +723,7 @@ METHOD inetErrorCode( SocketCon ) CLASS TIPClient
::nLastError := nRet
IF HB_ISBLOCK( ::bTrace )
IF HB_ISEVALITEM( ::bTrace )
::Log( SocketCon, nRet )
ENDIF
@@ -768,7 +769,7 @@ METHOD inetConnect( cServer, nPort, SocketCon ) CLASS TIPClient
/* TODO: Add error handling */
ENDIF
IF HB_ISBLOCK( ::bTrace )
IF HB_ISEVALITEM( ::bTrace )
::Log( cServer, nPort, SocketCon )
ENDIF
@@ -812,7 +813,7 @@ METHOD Log( ... ) CLASS TIPClient
LOCAL xVar
LOCAL cMsg
IF HB_ISBLOCK( ::bTrace )
IF HB_ISEVALITEM( ::bTrace )
cMsg := DToS( Date() ) + "-" + Time() + Space( 2 ) + ;
SubStr( ProcName( 1 ), RAt( ":", ProcName( 1 ) ) ) + ;

View File

@@ -481,22 +481,22 @@ STATIC FUNCTION LogError( oerr )
hb_WAEval( {||
IF hb_IsFunction( "Select" )
FWriteLine( nHandle, "Work Area No ......: " + strvalue( Eval( __dynsN2Sym( "Select" ) ) ) )
FWriteLine( nHandle, "Work Area No ......: " + strvalue( Do( "Select" ) ) )
ENDIF
IF hb_IsFunction( "Alias" )
FWriteLine( nHandle, "Alias .............: " + Eval( __dynsN2Sym( "Alias" ) ) )
FWriteLine( nHandle, "Alias .............: " + Do( "Alias" ) )
ENDIF
IF hb_IsFunction( "RecNo" )
FWriteLine( nHandle, "Current Recno .....: " + strvalue( Eval( __dynsN2Sym( "RecNo" ) ) ) )
FWriteLine( nHandle, "Current Recno .....: " + strvalue( Do( "RecNo" ) ) )
ENDIF
IF hb_IsFunction( "dbFilter" )
FWriteLine( nHandle, "Current Filter ....: " + Eval( __dynsN2Sym( "dbFilter" ) ) )
FWriteLine( nHandle, "Current Filter ....: " + Do( "dbFilter" ) )
ENDIF
IF hb_IsFunction( "dbRelation" )
FWriteLine( nHandle, "Relation Exp. .....: " + Eval( __dynsN2Sym( "dbRelation" ) ) )
FWriteLine( nHandle, "Relation Exp. .....: " + Do( "dbRelation" ) )
ENDIF
IF hb_IsFunction( "IndexOrd" )
FWriteLine( nHandle, "Index Order .......: " + strvalue( Eval( __dynsN2Sym( "IndexOrd" ) ) ) )
FWriteLine( nHandle, "Index Order .......: " + strvalue( Do( "IndexOrd" ) ) )
ENDIF
IF hb_IsFunction( "IndexKey" )
FWriteLine( nHandle, "Active Key ........: " + strvalue( Eval( hb_macroBlock( "IndexKey( 0 )" ) ) ) )