diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 025ee2ec66..032d53a6c7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,32 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-19 15:18 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/hbct/ctchksum.c + * contrib/hbct/ctcrypt.c + * contrib/hbct/ctnet.c + * contrib/hbct/ctdummy.prg + * contrib/hbct/ctmisc.prg + * contrib/hbct/ctrand.prg + * contrib/hbct/cttime.prg + * contrib/hbct/fcopy.prg + * contrib/hbct/getinfo.prg + * contrib/hbct/getinput.prg + * contrib/hbct/keysave.prg + * contrib/hbct/keysec.prg + * contrib/hbct/keytime.prg + * contrib/hbct/kxlat.prg + * contrib/hbct/screen3.prg + * contrib/hbct/scrmark.prg + * contrib/hbct/showtime.prg + * contrib/hbct/tempfile.prg + * hbformatted (using it with Maurizio's patch) + (with few minor corrections - vert.alignment, '/' operator) + * CA-T*ols + + * contrib/hbct/readme.txt + * deleted multiple ending EOLs + 2012-10-19 13:59 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbct/getsecrt.prg * SET() -> Set() diff --git a/harbour/contrib/hbct/ctchksum.c b/harbour/contrib/hbct/ctchksum.c index 9dddb9d15d..50848a27fb 100644 --- a/harbour/contrib/hbct/ctchksum.c +++ b/harbour/contrib/hbct/ctchksum.c @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * CHECKSUM() CA-Tools function + * CHECKSUM() CA-T*ols function * * Copyright 1999-2001 Viktor Szakats (harbour syenar.net) * www - http://harbour-project.org diff --git a/harbour/contrib/hbct/ctcrypt.c b/harbour/contrib/hbct/ctcrypt.c index b78fb97cf7..4fa44759ef 100644 --- a/harbour/contrib/hbct/ctcrypt.c +++ b/harbour/contrib/hbct/ctcrypt.c @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * CRYPT() CA-Tools compatible function + * CRYPT() CA-T*ols compatible function * * Copyright 1999-2001 Viktor Szakats (harbour syenar.net) * www - http://harbour-project.org diff --git a/harbour/contrib/hbct/ctdummy.prg b/harbour/contrib/hbct/ctdummy.prg index 1a68954a8b..32cc1a8bc0 100644 --- a/harbour/contrib/hbct/ctdummy.prg +++ b/harbour/contrib/hbct/ctdummy.prg @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * Dummy CA-Tools functions + * Dummy CA-T*ols functions * * Copyright 2008 Viktor Szakats (harbour syenar.net) * www - http://harbour-project.org @@ -51,6 +51,7 @@ */ FUNCTION dsetkbios( lNewKeyboardMode ) + THREAD STATIC t_lKeyboardMode := .T. HB_SYMBOL_UNUSED( lNewKeyboardMode ) diff --git a/harbour/contrib/hbct/ctmisc.prg b/harbour/contrib/hbct/ctmisc.prg index d6b15385e1..24c9547212 100644 --- a/harbour/contrib/hbct/ctmisc.prg +++ b/harbour/contrib/hbct/ctmisc.prg @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * Misc CA-Tools functions + * Misc CA-T*ols functions * * Copyright 1999-2001 Viktor Szakats (harbour syenar.net) * www - http://harbour-project.org @@ -55,8 +55,6 @@ #include "hbmemory.ch" -MEMVAR GetList - FUNCTION AlloFree( lMode ) IF ! HB_ISLOGICAL( lMode ) @@ -66,6 +64,7 @@ FUNCTION AlloFree( lMode ) RETURN Memory( iif( lMode, HB_MEM_CHAR, HB_MEM_BLOCK ) ) FUNCTION CENTER( c, n, p, lMode ) + LOCAL cRet IF ! HB_ISNUMERIC( n ) @@ -97,23 +96,28 @@ FUNCTION CSETCURS( l ) RETURN SetCursor( iif( l, SC_NORMAL, SC_NONE ) ) != SC_NONE FUNCTION CSETKEY( n ) + RETURN SetKey( n ) FUNCTION CSETCENT( nCentury ) - RETURN __SETCENTURY( nCentury ) + + RETURN __SetCentury( nCentury ) FUNCTION LTOC( l ) + RETURN iif( l, "T", "F" ) FUNCTION DOSPARAM() + LOCAL cRet := "" - LOCAL nCount := HB_ARGC(), i + LOCAL nCount := hb_argc(), i FOR i := 1 TO nCount - cRet += iif( i == 1, "", " " ) + HB_ARGV( i ) + cRet += iif( i == 1, "", " " ) + hb_argv( i ) NEXT RETURN cRet FUNCTION EXENAME() - RETURN HB_PROGNAME() + + RETURN hb_ProgName() diff --git a/harbour/contrib/hbct/ctnet.c b/harbour/contrib/hbct/ctnet.c index ad97867abb..802c89e666 100644 --- a/harbour/contrib/hbct/ctnet.c +++ b/harbour/contrib/hbct/ctnet.c @@ -73,7 +73,7 @@ * Return the shared resource name connected to a . * The original parameter in CA-Cl*pper Tools was changed to in * xHarbour because in Windows Network I didn't find a number table like in MS-DOS. See - * CA-Tools help for more details. + * CA-T*ols help for more details. * * NETWORK() -> lSuccess * Return true if a PC-LAN/MS-NET or Netware type is active. diff --git a/harbour/contrib/hbct/ctrand.prg b/harbour/contrib/hbct/ctrand.prg index afa2aaaa40..a53b359f6a 100644 --- a/harbour/contrib/hbct/ctrand.prg +++ b/harbour/contrib/hbct/ctrand.prg @@ -51,11 +51,14 @@ */ FUNCTION Random( lMode ) + RETURN iif( HB_ISLOGICAL( lMode ) .AND. lMode, ; - HB_RandomInt( -32768, 32767 ), HB_RandomInt( 0, 65535 ) ) + hb_RandomInt( -32768, 32767 ), hb_RandomInt( 0, 65535 ) ) FUNCTION Rand( nStart ) + IF nStart != NIL - HB_RandomSeed( nStart ) + hb_RandomSeed( nStart ) ENDIF - RETURN HB_Random() + + RETURN hb_Random() diff --git a/harbour/contrib/hbct/cttime.prg b/harbour/contrib/hbct/cttime.prg index 9ebbc68b31..3dc5f42d83 100644 --- a/harbour/contrib/hbct/cttime.prg +++ b/harbour/contrib/hbct/cttime.prg @@ -52,6 +52,7 @@ */ FUNCTION TIMETOSEC( cTime ) + LOCAL nSec := 0 LOCAL nLen, i, aLim, aMod, nInd, n @@ -64,7 +65,7 @@ FUNCTION TIMETOSEC( cTime ) aLim := { 24, 60, 60, 100 } aMod := { 3600, 60, 1, 1 / 100 } FOR i := 1 TO nLen STEP 3 - IF IsDigit( SubStr( cTime, i, 1 ) ) .AND. ; + IF IsDigit( SubStr( cTime, i , 1 ) ) .AND. ; IsDigit( SubStr( cTime, i + 1, 1 ) ) .AND. ; ( i == nLen - 1 .OR. SubStr( cTime, i + 2, 1 ) == ":" ) .AND. ; ( n := Val( SubStr( cTime, i, 2 ) ) ) < aLim[ nInd ] @@ -81,6 +82,7 @@ FUNCTION TIMETOSEC( cTime ) 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( ! HB_ISNUMERIC( nSec ), Seconds(), nSec ) @@ -101,5 +103,7 @@ FUNCTION SECTOTIME( nSec, lHundr ) RETURN h FUNCTION MILLISEC( nDelay ) - HB_IDLESLEEP( nDelay / 1000 ) + + hb_idleSleep( nDelay / 1000 ) + RETURN "" diff --git a/harbour/contrib/hbct/fcopy.prg b/harbour/contrib/hbct/fcopy.prg index 93add85b22..9180985f37 100644 --- a/harbour/contrib/hbct/fcopy.prg +++ b/harbour/contrib/hbct/fcopy.prg @@ -10,7 +10,7 @@ * Author...: Frederic J. Bell * Dated....: Jun,17 94 * Revised..: Sep,20 94 - * Purpose..: Replaces the following ca-tools functions which generate GPF's + * Purpose..: Replaces the following CA-T*ols functions which generate GPF's * FileCopy(), FileCOpen() & FileAppend()! * Relies on: Clipper (can you believe it!) * Compile..: /n /m /w /[/p /b /l] /es2 @@ -76,12 +76,14 @@ THREAD STATIC t_fileTime /* * FileCopy() - * This is a replacement for the CA-tools III function of the + * This is a replacement for the CA-T*ols III function of the * same name that causes GPF's. */ + FUNCTION FILECOPY( cSource, cDest, lMode ) + LOCAL hDstFile - LOCAL cBuffer := SPACE( F_BLOCK ) + LOCAL cBuffer := Space( F_BLOCK ) LOCAL lDone := .F. LOCAL nSrcBytes, nDstBytes, nTotBytes := 0 @@ -89,19 +91,19 @@ FUNCTION FILECOPY( cSource, cDest, lMode ) lMode := .F. ENDIF IF t_hSrcFile != F_ERROR - FCLOSE( t_hSrcFile ) + FClose( t_hSrcFile ) ENDIF - t_hSrcFile := FOPEN( cSource, FO_READ ) + t_hSrcFile := FOpen( cSource, FO_READ ) IF t_hSrcFile != F_ERROR - hDstFile := FCREATE( cDest ) + hDstFile := FCreate( cDest ) IF hDstFile != F_ERROR DO WHILE !lDone - nSrcBytes := FREAD( t_hSrcFile, @cBuffer, F_BLOCK ) + nSrcBytes := FRead( t_hSrcFile, @cBuffer, F_BLOCK ) IF nSrcBytes == 0 lDone := .T. EXIT ENDIF - nDstBytes := FWRITE( hDstFile, cBuffer, nSrcBytes ) + nDstBytes := FWrite( hDstFile, cBuffer, nSrcBytes ) IF nDstBytes > 0 nTotBytes += nDstBytes ENDIF @@ -109,9 +111,9 @@ FUNCTION FILECOPY( cSource, cDest, lMode ) EXIT ENDIF ENDDO - FCLOSE( hDstFile ) + FClose( hDstFile ) IF lDone .OR. !lMode - FCLOSE( t_hSrcFile ) + FClose( t_hSrcFile ) t_hSrcFile := F_ERROR ENDIF t_fileDate := FILEDATE( cSource ) @@ -120,16 +122,19 @@ FUNCTION FILECOPY( cSource, cDest, lMode ) SETFDATI( cDest, t_fileDate, t_fileTime ) ENDIF ELSE - FCLOSE( t_hSrcFile ) + FClose( t_hSrcFile ) t_hSrcFile := F_ERROR ENDIF ENDIF + RETURN nTotBytes FUNCTION FILECOPEN() + RETURN t_hSrcFile != F_ERROR FUNCTION FILECDATI( lNewMode ) + LOCAL lOldMode := t_lSetDaTi IF HB_ISLOGICAL( lNewMode ) @@ -139,21 +144,22 @@ FUNCTION FILECDATI( lNewMode ) RETURN lOldMode FUNCTION FILECCONT( cDest ) + LOCAL hDstFile - LOCAL cBuffer := SPACE( F_BLOCK ) + LOCAL cBuffer := Space( F_BLOCK ) LOCAL lDone := .F. LOCAL nSrcBytes, nDstBytes, nTotBytes := 0 IF t_hSrcFile != F_ERROR - hDstFile := FCREATE( cDest ) + hDstFile := FCreate( cDest ) IF hDstFile != F_ERROR DO WHILE !lDone - nSrcBytes := FREAD( t_hSrcFile, @cBuffer, F_BLOCK ) + nSrcBytes := FRead( t_hSrcFile, @cBuffer, F_BLOCK ) IF nSrcBytes == 0 lDone := 0 EXIT ENDIF - nDstBytes := FWRITE( hDstFile, cBuffer, nSrcBytes ) + nDstBytes := FWrite( hDstFile, cBuffer, nSrcBytes ) IF nDstBytes > 0 nTotBytes += nDstBytes ENDIF @@ -161,9 +167,9 @@ FUNCTION FILECCONT( cDest ) EXIT ENDIF ENDDO - FCLOSE( hDstFile ) + FClose( hDstFile ) IF lDone - FCLOSE( t_hSrcFile ) + FClose( t_hSrcFile ) t_hSrcFile := F_ERROR ENDIF IF t_lSetDaTi @@ -171,44 +177,49 @@ FUNCTION FILECCONT( cDest ) ENDIF ENDIF ENDIF + RETURN nTotBytes FUNCTION FILECCLOSE() + IF t_hSrcFile != F_ERROR - FCLOSE( t_hSrcFile ) + FClose( t_hSrcFile ) t_hSrcFile := F_ERROR RETURN .T. ENDIF + RETURN .F. FUNCTION FILEAPPEND( cSrc, cDest ) + LOCAL cBuffer := Space( F_BLOCK ) LOCAL hSrcFile, hDstFile LOCAL nSrcBytes, nDstBytes, nTotBytes := 0 - hSrcFile := FOPEN( cSrc, FO_READ ) + hSrcFile := FOpen( cSrc, FO_READ ) IF hSrcFile != F_ERROR IF !hb_FileExists( cDest ) - hDstFile := FCREATE( cDest ) + hDstFile := FCreate( cDest ) ELSE - hDstFile := FOPEN( cDest, FO_WRITE ) - FSEEK( hDstFile, 0, FS_END ) + hDstFile := FOpen( cDest, FO_WRITE ) + FSeek( hDstFile, 0, FS_END ) ENDIF IF hDstFile != F_ERROR DO WHILE .T. - nSrcBytes := FREAD( hSrcFile, @cBuffer, F_BLOCK ) + nSrcBytes := FRead( hSrcFile, @cBuffer, F_BLOCK ) IF nSrcBytes == 0 EXIT ENDIF - nDstBytes := FWRITE( hDstFile, cBuffer, nSrcBytes ) + nDstBytes := FWrite( hDstFile, cBuffer, nSrcBytes ) IF nDstBytes < nSrcBytes EXIT ENDIF nTotBytes += nDstBytes ENDDO - FCLOSE( hDstFile ) + FClose( hDstFile ) ENDIF - FCLOSE( hSrcFile ) + FClose( hSrcFile ) ENDIF + RETURN nTotBytes diff --git a/harbour/contrib/hbct/getinfo.prg b/harbour/contrib/hbct/getinfo.prg index 56b3465f05..14d70a09d2 100644 --- a/harbour/contrib/hbct/getinfo.prg +++ b/harbour/contrib/hbct/getinfo.prg @@ -56,43 +56,59 @@ MEMVAR GetList FUNCTION SAVEGETS() + LOCAL aGetList := GetList + GetList := {} + RETURN aGetList FUNCTION RESTGETS( aGetList ) + RETURN ( GetList := aGetList ) != NIL FUNCTION COUNTGETS() - RETURN LEN( GetList ) + + RETURN Len( GetList ) FUNCTION CURRENTGET() + LOCAL oActive := GetActive() - RETURN ASCAN( GetList, {| oGet | oGet == oActive } ) + + RETURN AScan( GetList, {| oGet | oGet == oActive } ) FUNCTION GETFLDROW( nField ) + LOCAL oGet + IF ! HB_ISNUMERIC( nField ) oGet := GetActive() - ELSEIF nField >= 1 .AND. nField <= LEN( GetList ) + ELSEIF nField >= 1 .AND. nField <= Len( GetList ) oGet := GetList[ nField ] ENDIF + RETURN iif( oGet != NIL, oGet:Row, -1 ) FUNCTION GETFLDCOL( nField ) + LOCAL oGet + IF ! HB_ISNUMERIC( nField ) oGet := GetActive() - ELSEIF nField >= 1 .AND. nField <= LEN( GetList ) + ELSEIF nField >= 1 .AND. nField <= Len( GetList ) oGet := GetList[ nField ] ENDIF + RETURN iif( oGet != NIL, oGet:Col, -1 ) FUNCTION GETFLDVAR( nField ) + LOCAL oGet + IF ! HB_ISNUMERIC( nField ) oGet := GetActive() - ELSEIF nField >= 1 .AND. nField <= LEN( GetList ) + ELSEIF nField >= 1 .AND. nField <= Len( GetList ) oGet := GetList[ nField ] ENDIF + RETURN iif( oGet != NIL, oGet:Name, -1 ) diff --git a/harbour/contrib/hbct/getinput.prg b/harbour/contrib/hbct/getinput.prg index ae48bc2737..4205fb447e 100644 --- a/harbour/contrib/hbct/getinput.prg +++ b/harbour/contrib/hbct/getinput.prg @@ -54,8 +54,9 @@ */ FUNCTION GETINPUT( xVar, nRow, nCol, lSay, xPrompt ) - LOCAL nCursorRow := ROW() - LOCAL nCursorCol := COL() + + LOCAL nCursorRow := Row() + LOCAL nCursorCol := Col() LOCAL GetList := {} IF ! HB_ISNUMERIC( nRow ) @@ -68,21 +69,21 @@ FUNCTION GETINPUT( xVar, nRow, nCol, lSay, xPrompt ) lSay := .F. ENDIF - SETPOS( nRow, nCol ) + SetPos( nRow, nCol ) IF xPrompt != Nil - DEVOUT( xPrompt ) - nRow := ROW() - nCol := COL() + 1 + DevOut( xPrompt ) + nRow := Row() + nCol := Col() + 1 ENDIF @ nRow, nCol GET xVar READ IF lSay - SETPOS( nRow, nCol ) - DEVOUT( xVar ) + SetPos( nRow, nCol ) + DevOut( xVar ) ENDIF - SETPOS( nCursorRow, nCursorCol ) + SetPos( nCursorRow, nCursorCol ) RETURN xVar diff --git a/harbour/contrib/hbct/keysave.prg b/harbour/contrib/hbct/keysave.prg index 084f53e34e..768e493835 100644 --- a/harbour/contrib/hbct/keysave.prg +++ b/harbour/contrib/hbct/keysave.prg @@ -50,8 +50,11 @@ */ FUNCTION SAVESETKEY() - RETURN HB_SETKEYSAVE() + + RETURN hb_SetKeySave() FUNCTION RESTSETKEY( aSavedTraps ) - HB_SETKEYSAVE( aSavedTraps ) + + hb_SetKeySave( aSavedTraps ) + RETURN .T. diff --git a/harbour/contrib/hbct/keysec.prg b/harbour/contrib/hbct/keysec.prg index 79c1f687f4..fb735bfe24 100644 --- a/harbour/contrib/hbct/keysec.prg +++ b/harbour/contrib/hbct/keysec.prg @@ -53,6 +53,7 @@ THREAD STATIC t_hIdle FUNCTION KeySec( nKey, nTime, nCounter, lMode ) + LOCAL nSeconds IF t_hIdle != NIL @@ -76,13 +77,14 @@ FUNCTION KeySec( nKey, nTime, nCounter, lMode ) nSeconds := hb_milliSeconds() t_hIdle := hb_idleAdd( {|| doKeySec( nKey, nTime, lMode, ; - @nCounter, @nSeconds ) } ) + @nCounter, @nSeconds ) } ) RETURN .T. ENDIF RETURN .F. STATIC PROCEDURE doKeySec( nKey, nTime, lMode, nCounter, nSeconds ) + LOCAL nSec := hb_milliSeconds() IF lMode .AND. ! Empty( NextKey() ) diff --git a/harbour/contrib/hbct/keytime.prg b/harbour/contrib/hbct/keytime.prg index 365b19a0f9..79d32612ce 100644 --- a/harbour/contrib/hbct/keytime.prg +++ b/harbour/contrib/hbct/keytime.prg @@ -53,6 +53,7 @@ THREAD STATIC t_hIdle FUNCTION KeyTime( nKey, cClockTime ) + LOCAL nHour, nMin, nSec, nLast IF t_hIdle != NIL @@ -62,17 +63,18 @@ FUNCTION KeyTime( nKey, cClockTime ) IF HB_ISNUMERIC( nKey ) .AND. HB_ISSTRING( cClockTime ) nHour := Val( SubStr( cClockTime, 1, 2 ) ) - nMin := Val( SubStr( cClockTime, 4, 2 ) ) - nSec := Val( SubStr( cClockTime, 7, 2 ) ) + nMin := Val( SubStr( cClockTime, 4, 2 ) ) + nSec := Val( SubStr( cClockTime, 7, 2 ) ) nLast := -1 t_hIdle := hb_idleAdd( {|| doKeyTime( nKey, cClockTime, nHour, nMin, nSec, ; - @nLast ) } ) + @nLast ) } ) RETURN .T. ENDIF RETURN .F. STATIC PROCEDURE doKeyTime( nKey, cClockTime, nHour, nMin, nSec, nLast ) + LOCAL ccTime := Time() LOCAL nHr := Val( SubStr( ccTime, 1, 2 ) ) LOCAL nMn := Val( SubStr( ccTime, 4, 2 ) ) diff --git a/harbour/contrib/hbct/kxlat.prg b/harbour/contrib/hbct/kxlat.prg index 2eabb3a1bc..7ec12fc3be 100644 --- a/harbour/contrib/hbct/kxlat.prg +++ b/harbour/contrib/hbct/kxlat.prg @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * [S|G]ETKX[LAT|TAB] CA-Tools functions (USE IT AT YOUR OWN RISK) + * [S|G]ETKX[LAT|TAB] CA-T*ols functions (USE IT AT YOUR OWN RISK) * * Copyright 2012 Viktor Szakats (harbour syenar.net) * www - http://harbour-project.org @@ -64,7 +64,7 @@ STATIC s_hTrs := { => } STATIC s_hMutex := hb_mutexCreate() -STATIC sc_hCnv := {; +STATIC sc_hCnv := { ; KS_DISABLE => 0 ,; KS_A => hb_keyCode( "A" ) ,; KS_B => hb_keyCode( "B" ) ,; @@ -330,6 +330,7 @@ FUNCTION __hbct_key_c_to_n( cKey ) RETURN NIL FUNCTION __hbct_key_n_to_c( nKey ) + LOCAL hKey IF HB_ISNUMERIC( nKey ) @@ -352,6 +353,7 @@ FUNCTION setkxlat( cOrgKeyValue, cNewKeyValue ) RETURN hbct_setkxlat( __hbct_key_c_to_n( cOrgKeyValue ), __hbct_key_c_to_n( cNewKeyValue ) ) FUNCTION getkxlat( cKeyValue ) + LOCAL xKey := hbct_getkxlat( __hbct_key_c_to_n( cKeyValue ) ) /* doc is unclear. should this return a numeric in these cases? */ @@ -362,6 +364,7 @@ FUNCTION getkxlat( cKeyValue ) RETURN __hbct_key_n_to_c( xKey ) FUNCTION setkxtab( cTrs ) + LOCAL hTrs := { => } LOCAL tmp @@ -374,6 +377,7 @@ FUNCTION setkxtab( cTrs ) RETURN hbct_setkxtab( hTrs ) FUNCTION getkxtab() + LOCAL cTrs := "" LOCAL hTrs := hbct_getkxtab() LOCAL hKey @@ -387,6 +391,7 @@ FUNCTION getkxtab() /* Harbour extensions using standard numeric key values */ FUNCTION hbct_setkxlat( nOrgKeyValue, nNewKeyValue ) + LOCAL lAccepted := .F. IF PCount() == 0 @@ -427,6 +432,7 @@ FUNCTION hbct_setkxlat( nOrgKeyValue, nNewKeyValue ) RETURN lAccepted FUNCTION hbct_getkxlat( nKeyValue ) + LOCAL nNewValue := 0 IF HB_ISNUMERIC( nKeyValue ) @@ -444,6 +450,7 @@ FUNCTION hbct_getkxlat( nKeyValue ) RETURN nNewValue FUNCTION hbct_setkxtab( hTrs ) + LOCAL lAccepted := .F. IF HB_ISHASH( hTrs ) @@ -465,6 +472,7 @@ FUNCTION hbct_setkxtab( hTrs ) RETURN lAccepted FUNCTION hbct_getkxtab() + LOCAL xRetVal IF hb_mutexLock( s_hMutex ) diff --git a/harbour/contrib/hbct/readme.txt b/harbour/contrib/hbct/readme.txt index 84f1c13191..b5023120a1 100644 --- a/harbour/contrib/hbct/readme.txt +++ b/harbour/contrib/hbct/readme.txt @@ -5,7 +5,7 @@ CA-T**ls Compatible Library for Harbour ======================================= -The goal of this library is to provide the functionality +The goal of this library is to provide the functionality of the original CA-T**ls 3 Library for CA-Cl*pper. Viktor Szakats (harbour syenar.net) @@ -19,7 +19,7 @@ Directories: ./ contains all the source files, include files, make files alt contains alternative function implementations (not all are complete, be aware !), mostly in Harbour, if the function is implemented in C and vice - versa. + versa. Changes and Enhancements over the original CA-T**ls 3 Library Martin Vogel @@ -47,7 +47,7 @@ Martin Vogel + CHARSUB() subtracts corresponding ASCII values -+ COSH() hyperbolic cosine ++ COSH() hyperbolic cosine + CSETARGERR() set behaviour on argument errors @@ -71,7 +71,7 @@ Martin Vogel + SINH() hyperbolic sine -* TABPACK() new 4th, 5th and 6th parameter to let one set the carriage-return-line-feed string, +* TABPACK() new 4th, 5th and 6th parameter to let one set the carriage-return-line-feed string, * TABEXPAND() the tab character and the chr(141)[soft line feed] behaviour + TANH() hyperbolic tangent @@ -93,9 +93,6 @@ Martin Vogel * TOKENUPPER() New 4th parameter * WEEK() New 2nd parameter ; week() function can either return - "simple week number" of week number defined by ISO 6801 + "simple week number" of week number defined by ISO 6801 + WORDREM() remove double characters from a string - - - diff --git a/harbour/contrib/hbct/screen3.prg b/harbour/contrib/hbct/screen3.prg index 35e5c88b52..933eb23acc 100644 --- a/harbour/contrib/hbct/screen3.prg +++ b/harbour/contrib/hbct/screen3.prg @@ -54,16 +54,21 @@ */ FUNCTION CLEAREOL( nRow, nCol, xAttr, xChar ) + IF ! HB_ISNUMERIC( nRow ) - nRow := ROW() + nRow := Row() ENDIF - RETURN CLEARWIN( nRow, nCol, nRow, /*MAXCOL()*/, xAttr, xChar ) + + RETURN CLEARWIN( nRow, nCol, nRow, /* MaxCol() */, xAttr, xChar ) FUNCTION CLEOL( nRow, nCol ) + IF ! HB_ISNUMERIC( nRow ) - nRow := ROW() + nRow := Row() ENDIF - RETURN CLEARWIN( nRow, nCol, nRow, /*MAXCOL()*/, 7 /*"W/N"*/, " " ) + + RETURN CLEARWIN( nRow, nCol, nRow, /* MaxCol() */, 7 /* "W/N" */, " " ) FUNCTION CLWIN( nRow, nCol ) - RETURN CLEARWIN( nRow, nCol, /*MAXROW()*/, /*MAXCOL()*/, 7 /*"W/N"*/, " " ) + + RETURN CLEARWIN( nRow, nCol, /* MaxRow() */, /* MaxCol() */, 7 /* "W/N" */, " " ) diff --git a/harbour/contrib/hbct/scrmark.prg b/harbour/contrib/hbct/scrmark.prg index d4ef8c32f4..19dbdf5314 100644 --- a/harbour/contrib/hbct/scrmark.prg +++ b/harbour/contrib/hbct/scrmark.prg @@ -56,6 +56,7 @@ */ FUNCTION SCREENMARK( cSearch, xAttr, lUpperLower, lAll, cForward, cTrailing ) + LOCAL lFound := .F. LOCAL nCount := 1 LOCAL nAt, nLen, nLast, nRow, nCol, nEnd, nCols @@ -74,26 +75,26 @@ FUNCTION SCREENMARK( cSearch, xAttr, lUpperLower, lAll, cForward, cTrailing ) cTrailing := NIL ENDIF - nCols := MAXCOL() - cScreen := SCREENTEXT( 0, 0, MAXROW(), nCols++ ) - nLen := LEN( cSearch ) - nLast := LEN( cScreen ) - nLen + 1 + nCols := MaxCol() + cScreen := SCREENTEXT( 0, 0, MaxRow(), nCols++ ) + nLen := Len( cSearch ) + nLast := Len( cScreen ) - nLen + 1 IF ! lUpperLower - cSearch := UPPER( cSearch ) - cScreen := UPPER( cScreen ) + cSearch := Upper( cSearch ) + cScreen := Upper( cScreen ) ENDIF DO WHILE ( nAt := ATNUM( cSearch, cScreen, nCount ) ) != 0 IF ( nAt == 1 .OR. cForward == NIL .OR. ; - SUBSTR( cScreen, nAt, 1 ) $ cForward ) .AND. ; - ( nAt == nLast .OR. cTrailing == NIL .OR. ; - SUBSTR( cScreen, nAt + nLen ) $ cTrailing ) + SubStr( cScreen, nAt, 1 ) $ cForward ) .AND. ; + ( nAt == nLast .OR. cTrailing == NIL .OR. ; + SubStr( cScreen, nAt + nLen ) $ cTrailing ) lFound := .T. --nAt - nRow := INT( nAt / nCols ) - nCol := INT( nAt % nCols ) - nEnd := nCol + LEN( cSearch ) - 1 + nRow := Int( nAt / nCols ) + nCol := Int( nAt % nCols ) + nEnd := nCol + Len( cSearch ) - 1 COLORWIN( nRow, nCol, nRow, nEnd, xAttr ) DO WHILE nEnd >= nCols nEnd -= nCols diff --git a/harbour/contrib/hbct/showtime.prg b/harbour/contrib/hbct/showtime.prg index 6ef4d57749..eb31093cfe 100644 --- a/harbour/contrib/hbct/showtime.prg +++ b/harbour/contrib/hbct/showtime.prg @@ -52,16 +52,17 @@ */ FUNCTION SHOWTIME( nRow, nCol, lNoSec, cColor, l12, lAmPm ) + THREAD STATIC t_hTimer := NIL - IF HB_ISNUMERIC( nRow ) .AND. nRow >= 0 .AND. nRow <= MAXROW( .T. ) + IF HB_ISNUMERIC( nRow ) .AND. nRow >= 0 .AND. nRow <= MaxRow( .T. ) IF t_hTimer != NIL - HB_IDLEDEL( t_hTimer ) + hb_idleDel( t_hTimer ) ENDIF - t_hTimer := HB_IDLEADD( {|| __HBCT_DSPTIME( nRow, nCol, lNoSec, cColor, ; - l12, lAmPm ) } ) + t_hTimer := hb_idleAdd( {|| __HBCT_DSPTIME( nRow, nCol, lNoSec, cColor, ; + l12, lAmPm ) } ) ELSEIF t_hTimer != NIL - HB_IDLEDEL( t_hTimer ) + hb_idleDel( t_hTimer ) t_hTimer := NIL ENDIF diff --git a/harbour/contrib/hbct/tempfile.prg b/harbour/contrib/hbct/tempfile.prg index 054ebf37b3..8e69ef5621 100644 --- a/harbour/contrib/hbct/tempfile.prg +++ b/harbour/contrib/hbct/tempfile.prg @@ -53,6 +53,7 @@ #include "fileio.ch" FUNCTION TempFile( cDir, cExt, nAttr ) + LOCAL cName LOCAL fhnd