From d047e39f92865571af6d6d4d26b54d0071dd5396 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 26 Sep 2012 17:28:40 +0000 Subject: [PATCH] 2012-09-26 19:25 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbnf/datecnfg.prg * contrib/hbnf/dfile.prg * contrib/hbnf/dispmsg.prg * contrib/hbnf/menu1.prg * contrib/hbnf/menutonf.prg * contrib/hbnf/nwsem.prg * contrib/hbnf/nwuid.prg * contrib/hbnf/scancode.prg * contrib/hbnf/scregion.prg * contrib/hbnf/sinkey.prg * contrib/hbnf/sqzn.prg * contrib/hbnf/tempfile.prg + more unicode compatibility updates. ; regressions possible, please review & test * minor formatting along the way * contrib/hbnf/dispc.c % globally visible variables made static. This introduces a slight incompatibility in case some C code tried to access these, though there was never a header for it, ie. they were never documented variables. --- harbour/ChangeLog | 24 ++++++++++++++++ harbour/contrib/hbnf/datecnfg.prg | 12 ++++---- harbour/contrib/hbnf/dfile.prg | 4 +-- harbour/contrib/hbnf/dispc.c | 48 +++++++++++++++---------------- harbour/contrib/hbnf/dispmsg.prg | 18 ++++++------ harbour/contrib/hbnf/menu1.prg | 6 ++-- harbour/contrib/hbnf/menutonf.prg | 4 +-- harbour/contrib/hbnf/nwsem.prg | 20 ++++++------- harbour/contrib/hbnf/nwuid.prg | 26 ++++++++--------- harbour/contrib/hbnf/scancode.prg | 10 +++---- harbour/contrib/hbnf/scregion.prg | 16 +++++++---- harbour/contrib/hbnf/sinkey.prg | 2 +- harbour/contrib/hbnf/sqzn.prg | 24 ++++++++-------- harbour/contrib/hbnf/tempfile.prg | 20 ++++++------- 14 files changed, 131 insertions(+), 103 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ef2039fdc9..5d2bef61ad 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,30 @@ The license applies to all entries newer than 2009-04-28. */ +2012-09-26 19:25 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/hbnf/datecnfg.prg + * contrib/hbnf/dfile.prg + * contrib/hbnf/dispmsg.prg + * contrib/hbnf/menu1.prg + * contrib/hbnf/menutonf.prg + * contrib/hbnf/nwsem.prg + * contrib/hbnf/nwuid.prg + * contrib/hbnf/scancode.prg + * contrib/hbnf/scregion.prg + * contrib/hbnf/sinkey.prg + * contrib/hbnf/sqzn.prg + * contrib/hbnf/tempfile.prg + + more unicode compatibility updates. + ; regressions possible, please review & test + * minor formatting along the way + + * contrib/hbnf/dispc.c + % globally visible variables made static. + This introduces a slight incompatibility in case + some C code tried to access these, though there was + never a header for it, ie. they were never + documented variables. + 2012-09-26 17:54 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbnf/bitclr.prg * contrib/hbnf/bitset.prg diff --git a/harbour/contrib/hbnf/datecnfg.prg b/harbour/contrib/hbnf/datecnfg.prg index 3b8170a028..d3680e80a7 100644 --- a/harbour/contrib/hbnf/datecnfg.prg +++ b/harbour/contrib/hbnf/datecnfg.prg @@ -134,31 +134,31 @@ FUNCTION DEMO() aTestData := FT_ACCTQTR( dDate ) ? "ACCTQtr ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ], ; - Str( ( aTestData[ 3 ] - aTestData[ 2 ] + 1 ) /7, 3 ) + " Weeks" + Str( ( aTestData[ 3 ] - aTestData[ 2 ] + 1 ) / 7, 3 ) + " Weeks" - nNum := Val( SubStr( aTestData[ 1 ],5,2 ) ) + nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) ) aTestData := FT_ACCTQTR( dDate, nNum ) ? "ACCTQtr " + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ] aTestData := FT_ACCTMONTH( dDate ) ? "ACCTMonth ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ], ; - Str( ( aTestData[ 3 ] - aTestData[ 2 ] + 1 ) /7, 3 ) + " Weeks" + Str( ( aTestData[ 3 ] - aTestData[ 2 ] + 1 ) / 7, 3 ) + " Weeks" - nNum := Val( SubStr( aTestData[ 1 ],5,2 ) ) + nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) ) aTestData := FT_ACCTMONTH( dDate, nNum ) ? "ACCTMonth" + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ] aTestData := FT_ACCTWEEK( dDate ) ? "ACCTWeek ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ] - nNum := Val( SubStr( aTestData[ 1 ],5,2 ) ) + nNum := Val( SubStr( aTestData[ 1 ], 5, 2 ) ) aTestData := FT_ACCTWEEK( dDate, nNum ) ? "ACCTWeek " + Str( nNum, 2 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ] aTestData := FT_DAYOFYR( dDate, , .T. ) ? "ACCTDay ", aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ] - nNum := Val( SubStr( aTestData[ 1 ],5,3 ) ) + nNum := Val( SubStr( aTestData[ 1 ], 5, 3 ) ) aTestData := FT_DAYOFYR( dDate, nNum, .T. ) ? "ACCTDay " + Str( nNum, 3 ), aTestData[ 1 ], aTestData[ 2 ], aTestData[ 3 ] diff --git a/harbour/contrib/hbnf/dfile.prg b/harbour/contrib/hbnf/dfile.prg index 32d48670e0..07873ff72d 100644 --- a/harbour/contrib/hbnf/dfile.prg +++ b/harbour/contrib/hbnf/dfile.prg @@ -61,14 +61,14 @@ PROCEDURE Main() * REMEMBER A WINDOW WILL BE ONE SIZE LESS AND GREATER THAN THE PASSED COORD.'S * * THE 9TH PARAMETER CONTAINS THE KEYS THAT THE ROUTINE WILL TERMINATE ON - * AND THE CHR(143) represents the F3 key. + * AND THE hb_BChar(143) represents the F3 key. * */ @ 4, 9 TO 11, 71 FT_DFSETUP( cInFile, 5, 10, 10, 70, nStart, ; - nNColor, nHColor, cExitKeys + Chr( 143 ), ; + nNColor, nHColor, cExitKeys + hb_BChar( 143 ), ; lBrowse, nColSkip, nRMargin, nBuffSize ) cKey := FT_DISPFILE() diff --git a/harbour/contrib/hbnf/dispc.c b/harbour/contrib/hbnf/dispc.c index a8a0b7760f..00e324bfd4 100644 --- a/harbour/contrib/hbnf/dispc.c +++ b/harbour/contrib/hbnf/dispc.c @@ -73,31 +73,31 @@ #define TABSET 8 -HB_FOFFSET buffoffset; /* offset into buffer of current line */ -HB_FOFFSET fsize; /* file size in bytes */ -HB_ISIZ bufftop, buffbot; /* first and last character in buffer */ -int wintop, winbot; /* first and last character in window */ -int winrow, wincol; /* row and column of window highlight */ -int sline, eline; /* start and end line of window */ -int scol, ecol; /* start and end col of window */ -int height, width; /* height and width of window */ -HB_FHANDLE infile; /* input file handle */ -int maxlin; /* line size */ -HB_ISIZ buffsize; /* buffer size */ -int hlight; /* highlight attribute */ -int norm; /* normal attribute */ -HB_ISIZ kcount; /* number of keys in terminate key list*/ -int colinc; /* col increment amount */ -HB_BOOL bBrowse; /* browse flag */ -HB_BOOL bRefresh; /* HB_TRUE means refresh screen */ -char kstr[ 25 ]; /* terminate key string */ -int keylist[ 24 ]; /* terminate key list */ -int keytype; /* K_STRING or K_LIST */ +static HB_FOFFSET buffoffset; /* offset into buffer of current line */ +static HB_FOFFSET fsize; /* file size in bytes */ +static HB_ISIZ bufftop, buffbot; /* first and last character in buffer */ +static int wintop, winbot; /* first and last character in window */ +static int winrow, wincol; /* row and column of window highlight */ +static int sline, eline; /* start and end line of window */ +static int scol, ecol; /* start and end col of window */ +static int height, width; /* height and width of window */ +static HB_FHANDLE infile; /* input file handle */ +static int maxlin; /* line size */ +static HB_ISIZ buffsize; /* buffer size */ +static int hlight; /* highlight attribute */ +static int norm; /* normal attribute */ +static HB_ISIZ kcount; /* number of keys in terminate key list*/ +static int colinc; /* col increment amount */ +static HB_BOOL bBrowse; /* browse flag */ +static HB_BOOL bRefresh; /* HB_TRUE means refresh screen */ +static char kstr[ 25 ]; /* terminate key string */ +static int keylist[ 24 ]; /* terminate key list */ +static int keytype; /* K_STRING or K_LIST */ -HB_BOOL bIsAllocated; /* if buffers were allocated */ -char * buffer; /* file buffer pointer */ -char * lbuff; /* line buffer pointer */ -char * vseg; /* video segment variable */ +static HB_BOOL bIsAllocated; /* if buffers were allocated */ +static char * buffer; /* file buffer pointer */ +static char * lbuff; /* line buffer pointer */ +static char * vseg; /* video segment variable */ /* prototypes */ diff --git a/harbour/contrib/hbnf/dispmsg.prg b/harbour/contrib/hbnf/dispmsg.prg index cba9808037..54a2e1b200 100644 --- a/harbour/contrib/hbnf/dispmsg.prg +++ b/harbour/contrib/hbnf/dispmsg.prg @@ -79,7 +79,8 @@ PROCEDURE Main( cCmdLine ) "[Esc]ape [Alt-Q]" }, ; { cErrN, cErrN, cErrH } }, , 2 ) - nType := FT_DispMsg( { { "Create Or Edit [I]nvoice", ; + nType := FT_DispMsg( { { ; + "Create Or Edit [I]nvoice", ; "Create Or Edit [O]rder", ; "Create Or Edit [B]ack Order", ; "Create Or Edit [Q]uote", ; @@ -94,7 +95,6 @@ PROCEDURE Main( cCmdLine ) QUIT #endif -// end of demo program FUNCTION FT_DispMsg( aInfo, cKey, nBoxTop, nBoxLeft, cnBoxString, lShadow ) @@ -118,7 +118,7 @@ FUNCTION FT_DispMsg( aInfo, cKey, nBoxTop, nBoxLeft, cnBoxString, lShadow ) AAdd( aPos, {} ) NEXT - FOR i := 1 TO Len( aInfo[1] ) + FOR i := 1 TO Len( aInfo[ 1 ] ) DO WHILE At( "[", aInfo[ 1, i ] ) > 0 x := At( "[", aInfo[ 1, i ] ) @@ -141,7 +141,7 @@ FUNCTION FT_DispMsg( aInfo, cKey, nBoxTop, nBoxLeft, cnBoxString, lShadow ) /* IF nBoxTop == NIL - nTop := ( MAXROW() - LEN( aInfo[ 1 ] ) - 2 ) / 2 + 2 + nTop := ( MaxRow() - Len( aInfo[ 1 ] ) - 2 ) / 2 + 2 ENDIF */ @@ -172,10 +172,10 @@ FUNCTION FT_DispMsg( aInfo, cKey, nBoxTop, nBoxLeft, cnBoxString, lShadow ) cOldCursor := SetCursor( SC_NONE ) // draw box - cOldColor := SetColor( aInfo[ 2, LEN( aInfo[ 2 ] ) ] ) + cOldColor := SetColor( aInfo[ 2, Len( aInfo[ 2 ] ) ] ) DispBox( nBoxTop, nBoxLeft, nBoxBottom, nBoxRight, cnBoxString, ; - aInfo[ 2, LEN( aInfo[ 2 ] ) ] ) + aInfo[ 2, Len( aInfo[ 2 ] ) ] ) IF lShadow FT_Shadow( nBoxTop, nBoxLeft, nBoxBottom, nBoxRight ) ENDIF @@ -210,19 +210,19 @@ FUNCTION FT_DispMsg( aInfo, cKey, nBoxTop, nBoxLeft, cnBoxString, lShadow ) aPos[ i, j, 1 ] + aLeft[ i ] - 1, ; nBoxTop + i, ; aPos[ i, j, 2 ] + aLeft[ i ] - 1, ; - FT_Color2N( aInfo[ 2, LEN( aInfo[ 2 ] ) ] ) ) + FT_Color2N( aInfo[ 2, Len( aInfo[ 2 ] ) ] ) ) NEXT NEXT IF cKey != NIL IF Len( cKey ) == 1 nOption := FT_SInkey( 0 ) - IF Upper( Chr( nOption ) ) == cKey + IF Upper( hb_keyChar( nOption ) ) == cKey xRtnVal := .T. ENDIF ELSE nOption := 0 - DO WHILE At( Upper( Chr( nOption ) ), Upper( cKey ) ) == 0 + DO WHILE At( Upper( hb_keyChar( nOption ) ), Upper( cKey ) ) == 0 nOption := FT_SInkey( 0 ) ENDDO xRtnVal := nOption diff --git a/harbour/contrib/hbnf/menu1.prg b/harbour/contrib/hbnf/menu1.prg index a8af82bcdb..60ac8fa667 100644 --- a/harbour/contrib/hbnf/menu1.prg +++ b/harbour/contrib/hbnf/menu1.prg @@ -256,7 +256,7 @@ FUNCTION FT_MENU1( aBar, aOptions, aColors, nTopRow, lShadow ) // store inkey code for each item on menu bar to aBarKeys AEval( aBarKeys, {| x, i | HB_SYMBOL_UNUSED( x ), aBarKeys[ i ] := ; - aKeyCodes[ Asc( Upper( LTrim( aBar[ i ] ) ) ) - 64 ] } ) + aKeyCodes[ Asc( Upper( LTrim( aBar[ i ] ) ) ) - Asc( "@" ) ] } ) // disable Alt-C and Alt-D lCancMode := SetCancel( .F. ) @@ -318,8 +318,8 @@ FUNCTION __ftAcUdf( nMode ) CASE nMode == AC_HITBOTTOM hb_keyPut( K_CTRL_HOME ) CASE nMode == AC_EXCEPT - IF Upper( Chr( LastKey() ) ) $ aValidKeys[ nHpos ] - IF aChoices[ nHpos, 3, At( Upper( Chr( LastKey() ) ), aValidKeys[ nHpos ] ) ] + IF Upper( hb_keyChar( LastKey() ) ) $ aValidKeys[ nHpos ] + IF aChoices[ nHpos, 3, At( Upper( hb_keyChar( LastKey() ) ), aValidKeys[ nHpos ] ) ] hb_keyPut( K_ENTER ) nRtnVal := AC_GOTO ENDIF diff --git a/harbour/contrib/hbnf/menutonf.prg b/harbour/contrib/hbnf/menutonf.prg index 3337e93e9f..fed4739960 100644 --- a/harbour/contrib/hbnf/menutonf.prg +++ b/harbour/contrib/hbnf/menutonf.prg @@ -49,8 +49,8 @@ #xtranslate isBetween( , , ) => ; ( < val > \ >= < lower > .AND. < val > \ <= < upper > ) -#define nTriggerInkey asc( upper( substr( cPrompt, nTrigger, 1 ) ) ) -#define cTrigger substr( cPrompt, nTrigger, 1 ) +#define nTriggerInkey hb_keyCode( Upper( SubStr( cPrompt, nTrigger, 1 ) ) ) +#define cTrigger SubStr( cPrompt, nTrigger, 1 ) #define nCurrent nMenu,nActive #define nLast nMenu,nPrev diff --git a/harbour/contrib/hbnf/nwsem.prg b/harbour/contrib/hbnf/nwsem.prg index 25c97ae6fe..1caa9f2988 100644 --- a/harbour/contrib/hbnf/nwsem.prg +++ b/harbour/contrib/hbnf/nwsem.prg @@ -108,8 +108,8 @@ FUNCTION ft_nwSemOpen( cName, nInitVal, nHandle, nOpenCnt ) DEFAULT nHandle TO 0 DEFAULT nOpenCnt TO 0 - cName := iif( Len( cName ) > 127, SubStr( cName, 1, 127 ), cName ) - cRequest := Chr( Len( cName ) ) + cName + cName := iif( hb_BLen( cName ) > 127, hb_BSubStr( cName, 1, 127 ), cName ) + cRequest := hb_BChar( Len( cName ) ) + cName aRegs[ AX ] := makehi( 197 ) // C5h aRegs[ DS ] := cRequest @@ -118,10 +118,10 @@ FUNCTION ft_nwSemOpen( cName, nInitVal, nHandle, nOpenCnt ) ft_int86( INT21, aRegs ) - nHandle := Bin2L( I2Bin( aRegs[CX] ) + I2Bin( aRegs[DX] ) ) + nHandle := Bin2L( I2Bin( aRegs[ CX ] ) + I2Bin( aRegs[ DX ] ) ) nOpenCnt := lowbyte( aRegs[ BX ] ) - nRet := lowbyte( aRegs[AX] ) + nRet := lowbyte( aRegs[ AX ] ) RETURN iif( nRet < 0, nRet + 256, nRet ) @@ -134,15 +134,15 @@ FUNCTION ft_nwSemEx( nHandle, nValue, nOpenCnt ) DEFAULT nOpenCnt TO 0 aRegs[ AX ] := makehi( 197 ) + 1 // C5h, 01h - aRegs[ CX ] := Bin2I( SubStr( L2Bin( nHandle ), 1, 2 ) ) - aRegs[ DX ] := Bin2I( SubStr( L2Bin( nHandle ), 3, 2 ) ) + aRegs[ CX ] := Bin2I( hb_BSubStr( L2Bin( nHandle ), 1, 2 ) ) + aRegs[ DX ] := Bin2I( hb_BSubStr( L2Bin( nHandle ), 3, 2 ) ) ft_int86( INT21, aRegs ) #ifdef FT_TEST - @ 5, 1 SAY highbyte( aregs[CX] ) - @ 6, 1 SAY lowbyte( aregs[CX ] ) + @ 5, 1 SAY highbyte( aregs[ CX ] ) + @ 6, 1 SAY lowbyte( aregs[ CX ] ) #endif @@ -177,8 +177,8 @@ STATIC FUNCTION _ftnwsem( nOp, nHandle, nTimeout ) DEFAULT nTimeout TO 0 aRegs[ AX ] := makehi( 197 ) + nOp - aRegs[ CX ] := Bin2I( SubStr( L2Bin( nHandle ), 1, 2 ) ) - aRegs[ DX ] := Bin2I( SubStr( L2Bin( nHandle ), 3, 2 ) ) + aRegs[ CX ] := Bin2I( hb_BSubStr( L2Bin( nHandle ), 1, 2 ) ) + aRegs[ DX ] := Bin2I( hb_BSubStr( L2Bin( nHandle ), 3, 2 ) ) aRegs[ BP ] := nTimeout ft_int86( INT21, aRegs ) diff --git a/harbour/contrib/hbnf/nwuid.prg b/harbour/contrib/hbnf/nwuid.prg index 8dd70c03fe..c357022e3f 100644 --- a/harbour/contrib/hbnf/nwuid.prg +++ b/harbour/contrib/hbnf/nwuid.prg @@ -63,26 +63,26 @@ FUNCTION FT_NWUID( nConn ) LOCAL cReqPkt LOCAL cRepPkt - nConn := iif( nConn == nil, FT_NWLSTAT(), nConn ) + nConn := iif( nConn == NIL, FT_NWLSTAT(), nConn ) -// Set up request packet + // Set up request packet - cReqPkt := Chr( 22 ) // Function 22: Get Connection Information - cReqPkt += Chr( nConn ) - cReqPkt := I2Bin( Len( cReqPkt ) ) + cReqPkt + cReqPkt := hb_BChar( 22 ) // Function 22: Get Connection Information + cReqPkt += hb_BChar( nConn ) + cReqPkt := I2Bin( hb_BLen( cReqPkt ) ) + cReqPkt -// Set up reply packet + // Set up reply packet cRepPkt := Space( 63 ) -// Assign registers + // Assign registers - aRegs[ AX ] := MAKEHI( NW_LOG ) - aRegs[ DS ] := cReqPkt - aRegs[ SI ] := REG_DS - aRegs[ ES ] := cRepPkt - aRegs[ DI ] := REG_ES + aRegs[ AX ] := MAKEHI( NW_LOG ) + aRegs[ DS ] := cReqPkt + aRegs[ SI ] := REG_DS + aRegs[ ES ] := cRepPkt + aRegs[ DI ] := REG_ES FT_INT86( DOS, aRegs ) - RETURN AllTrim( StrTran( SubStr( aRegs[ ES ], 9, 48 ), Chr( 0 ) ) ) + RETURN AllTrim( StrTran( hb_BSubStr( aRegs[ ES ], 9, 48 ), hb_BChar( 0 ) ) ) diff --git a/harbour/contrib/hbnf/scancode.prg b/harbour/contrib/hbnf/scancode.prg index 1942729c6a..c3cbd4b8f3 100644 --- a/harbour/contrib/hbnf/scancode.prg +++ b/harbour/contrib/hbnf/scancode.prg @@ -29,22 +29,20 @@ #include "ftint86.ch" -#define KEYB 22 - #ifdef FT_TEST #define SCANCODE_ESCAPE ( hb_BChar( 27 ) + hb_BChar( 1 ) ) PROCEDURE Main() - LOCAL getlist, cKey + LOCAL cKey - CLEAR + CLS QOut( "Press any key, ESCape to exit:" ) DO WHILE .T. cKey := FT_SCANCODE() - QOut( "chr(" + Str( Asc( SubStr( cKey, 1, 1 ) ), 3 ) + ")+chr(" + Str( Asc( SubStr( cKey, 2, 1 ) ), 3 ) + ")" ) + QOut( Str( hb_BCode( hb_BSubStr( cKey, 1, 1 ) ), 3 ) + ", " + Str( hb_BCode( hb_BSubStr( cKey, 2, 1 ) ), 3 ) + hb_eol() ) IF cKey == SCANCODE_ESCAPE EXIT ENDIF @@ -54,6 +52,8 @@ PROCEDURE Main() #endif +#define KEYB 22 + FUNCTION FT_SCANCODE() LOCAL aRegs[ INT86_MAX_REGS ] diff --git a/harbour/contrib/hbnf/scregion.prg b/harbour/contrib/hbnf/scregion.prg index b8ec66def9..918c305b20 100644 --- a/harbour/contrib/hbnf/scregion.prg +++ b/harbour/contrib/hbnf/scregion.prg @@ -28,18 +28,22 @@ THREAD STATIC t_aRgnStack := {} FUNCTION FT_SAVRGN( nTop, nLeft, nBottom, nRight ) - RETURN Chr( nTop ) + Chr( nLeft ) + Chr( nBottom ) + Chr( nRight ) + ; + RETURN hb_BChar( nTop ) + hb_BChar( nLeft ) + hb_BChar( nBottom ) + hb_BChar( nRight ) + ; SaveScreen( nTop, nLeft, nBottom, nRight ) FUNCTION FT_RSTRGN( cScreen, nTop, nLeft ) IF PCount() == 3 - RestScreen( nTop, nLeft, ( nTop - Asc(cScreen ) ) + Asc( SubStr( cScreen, 3 ) ), ; - ( nLeft - Asc( SubStr( cScreen, 2 ) ) ) + Asc( SubStr( cScreen, 4 ) ), ; - SubStr( cScreen, 5 ) ) + RestScreen( nTop, nLeft,; + ( nTop - hb_BCode( hb_BSubStr( cScreen, 1, 1 ) ) ) + hb_BCode( hb_BSubStr( cScreen, 3, 1 ) ), ; + ( nLeft - hb_BCode( hb_BSubStr( cScreen, 2, 1 ) ) ) + hb_BCode( hb_BSubStr( cScreen, 4, 1 ) ), ; + hb_BSubStr( cScreen, 5 ) ) ELSE - RestScreen( Asc( cScreen ), Asc( SubStr( cScreen, 2 ) ), Asc( SubStr( cScreen, 3 ) ), ; - Asc( SubStr( cScreen, 4 ) ), SubStr( cScreen, 5 ) ) + RestScreen( hb_BCode( hb_BSubStr( cScreen, 1, 1 ) ),; + hb_BCode( hb_BSubStr( cScreen, 2, 1 ) ),; + hb_BCode( hb_BSubStr( cScreen, 3, 1 ) ),; + hb_BCode( hb_BSubStr( cScreen, 4, 1 ) ),; + hb_BSubStr( cScreen, 5 ) ) ENDIF RETURN NIL diff --git a/harbour/contrib/hbnf/sinkey.prg b/harbour/contrib/hbnf/sinkey.prg index 377320cbbd..792de4e590 100644 --- a/harbour/contrib/hbnf/sinkey.prg +++ b/harbour/contrib/hbnf/sinkey.prg @@ -57,4 +57,4 @@ FUNCTION FT_SINKEY( waittime ) ENDIF - RETURN KEY + RETURN key diff --git a/harbour/contrib/hbnf/sqzn.prg b/harbour/contrib/hbnf/sqzn.prg index a72b524a64..6c6a72e120 100644 --- a/harbour/contrib/hbnf/sqzn.prg +++ b/harbour/contrib/hbnf/sqzn.prg @@ -25,16 +25,16 @@ FUNCTION ft_sqzn( nValue, nSize, nDecimals ) LOCAL tmpstr, cCompressed, k - nSize := iif( nSize == NIL, 10, nSize ) + nSize := iif( nSize == NIL, 10, nSize ) nDecimals := iif( nDecimals == NIL, 0, nDecimals ) nValue := nValue * ( 10 ** nDecimals ) nSize := iif( nSize / 2 != Int( nSize / 2 ), nSize + 1, nSize ) tmpstr := Str( Abs( nValue ), nSize ) tmpstr := StrTran( tmpstr, " ", "0" ) - cCompressed := Chr( Val( SubStr( tmpstr, 1, 2 ) ) + iif( nValue < 0, 128, 0 ) ) + cCompressed := hb_BChar( Val( hb_BSubStr( tmpstr, 1, 2 ) ) + iif( nValue < 0, 128, 0 ) ) - FOR k := 3 TO Len( tmpstr ) STEP 2 - cCompressed += Chr( Val( SubStr( tmpstr, k, 2 ) ) ) + FOR k := 3 TO hb_BLen( tmpstr ) STEP 2 + cCompressed += hb_BChar( Val( hb_BSubStr( tmpstr, k, 2 ) ) ) NEXT RETURN cCompressed @@ -45,20 +45,20 @@ FUNCTION ft_unsqzn( cCompressed, nSize, nDecimals ) nSize := iif( nSize == NIL, 10, nSize ) nDecimals := iif( nDecimals == NIL, 0, nDecimals ) - cCompressed := iif( multi == - 1, SubStr( cCompressed, 2 ), cCompressed ) + cCompressed := iif( multi == - 1, hb_BSubStr( cCompressed, 2 ), cCompressed ) nSize := iif( nSize / 2 != Int( nSize / 2 ), nSize + 1, nSize ) - IF Asc( cCompressed ) > 127 - tmp := Str( Asc( cCompressed ) - 128, 2 ) - multi := - 1 + IF hb_BCode( cCompressed ) > 127 + tmp := Str( hb_BCode( cCompressed ) - 128, 2 ) + multi := -1 ELSE - tmp := Str( Asc( cCompressed ), 2 ) + tmp := Str( hb_BCode( cCompressed ), 2 ) ENDIF - FOR k := 2 TO Len( cCompressed ) - tmp += Str( Asc( SubStr( cCompressed, k, 1 ) ), 2 ) + FOR k := 2 TO hb_BLen( cCompressed ) + tmp += Str( hb_BCode( hb_BSubStr( cCompressed, k, 1 ) ), 2 ) NEXT tmp := StrTran( tmp, " ", "0" ) - cValue := SubStr( tmp, 1, nSize - nDecimals ) + "." + SubStr( tmp, nSize - nDecimals + 1 ) + cValue := hb_BSubStr( tmp, 1, nSize - nDecimals ) + "." + hb_BSubStr( tmp, nSize - nDecimals + 1 ) RETURN Val( cValue ) * multi diff --git a/harbour/contrib/hbnf/tempfile.prg b/harbour/contrib/hbnf/tempfile.prg index 9cfb0064de..f10fd36d71 100644 --- a/harbour/contrib/hbnf/tempfile.prg +++ b/harbour/contrib/hbnf/tempfile.prg @@ -63,18 +63,18 @@ FUNCTION FT_TEMPFIL( cPath, lHide, nHandle ) LOCAL cRet, aRegs[ 3 ] cPath := iif( ! HB_ISSTRING( cPath ), ; - Replicate( Chr( 0 ), 13 ) , ; - cPath += Replicate( Chr( 0 ), 13 ) ) + Replicate( hb_BChar( 0 ), 13 ) , ; + cPath += Replicate( hb_BChar( 0 ), 13 ) ) lHide := iif( HB_ISLOGICAL( lHide ), lHide, .F. ) - /* - aRegs[ AX ] := MAKEHI( TEMPNAME ) - aRegs[ CX ] := iif( lHide, 2, 0 ) - aRegs[ DS ] := cPath - aRegs[ DX ] := REG_DS + /* + aRegs[ AX ] := MAKEHI( TEMPNAME ) + aRegs[ CX ] := iif( lHide, 2, 0 ) + aRegs[ DS ] := cPath + aRegs[ DX ] := REG_DS - FT_INT86( DOS, aRegs ) - */ + FT_INT86( DOS, aRegs ) + */ aRegs := _ft_tempfil( cPath, lHide ) /* If carry flag is clear, then call succeeded and a file handle is * sitting in AX that needs to be closed. @@ -86,7 +86,7 @@ FUNCTION FT_TEMPFIL( cPath, lHide, nHandle ) ELSE FClose( aRegs[ 1 ] ) ENDIF - cRet := AllTrim( StrTran( aRegs[ 2 ], Chr( 0 ) ) ) + cRet := AllTrim( StrTran( aRegs[ 2 ], hb_BChar( 0 ) ) ) ELSE cRet := "" ENDIF