2012-09-26 16:41 UTC+0200 Viktor Szakats (harbour syenar.net)

* contrib/hbnf/dosver.prg
  * contrib/hbnf/eltime.prg
  * contrib/hbnf/floptst.prg
  * contrib/hbnf/miltime.prg
  * contrib/hbnf/min2dhm.prg
  * contrib/hbnf/mouse1.prg
  * contrib/hbnf/mouse2.prg
  * contrib/hbnf/nwsem.prg
  * contrib/hbnf/popadder.prg
    % use hb_ntos(). (lots of them can be further reduced to StrZero())
    % minors
This commit is contained in:
Viktor Szakats
2012-09-26 14:43:02 +00:00
parent 88676aaf35
commit a036501600
10 changed files with 43 additions and 34 deletions

View File

@@ -16,6 +16,19 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-09-26 16:41 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbnf/dosver.prg
* contrib/hbnf/eltime.prg
* contrib/hbnf/floptst.prg
* contrib/hbnf/miltime.prg
* contrib/hbnf/min2dhm.prg
* contrib/hbnf/mouse1.prg
* contrib/hbnf/mouse2.prg
* contrib/hbnf/nwsem.prg
* contrib/hbnf/popadder.prg
% use hb_ntos(). (lots of them can be further reduced to StrZero())
% minors
2012-09-26 16:29 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbnf/acctadj.prg
* contrib/hbnf/acctmnth.prg

View File

@@ -47,8 +47,8 @@ FUNCTION FT_DOSVER()
/* aRegs[ AX ] := MAKEHI( DOSVER )
IF FT_INT86( DOS, aRegs )
cResult := AllTrim( Str( LOWBYTE( aRegs[ AX ] ) ) ) + "." + ;
AllTrim( Str( HIGHBYTE( aRegs[ AX ] ) ) )
cResult := hb_ntos( LOWBYTE( aRegs[ AX ] ) ) + "." + ;
hb_ntos( HIGHBYTE( aRegs[ AX ] ) )
ENDIF
*/
cResult := _get_dosver()

View File

@@ -37,8 +37,8 @@ FUNCTION FT_ELTIME( cTIME1, cTIME2 )
nMINS := Int( ( nDELSECS - nHRS * 3600 ) / 60 )
nSECS := nDELSECS - ( nHRS * 3600 ) - ( nMINS * 60 )
RETURN Right( "00" + LTrim( Str( nHRS ) ), 2 ) + ;
":" + ;
Right( "00" + LTrim( Str( nMINS ) ), 2 ) + ;
":" + ;
Right( "00" + LTrim( Str( nSECS ) ), 2 )
RETURN Right( "00" + hb_ntos( nHRS ), 2 ) + ;
":" + ;
Right( "00" + hb_ntos( nMINS ), 2 ) + ;
":" + ;
Right( "00" + hb_ntos( nSECS ), 2 )

View File

@@ -55,7 +55,7 @@ PROCEDURE Main( cArg1 )
IF HB_ISSTRING( cArg1 )
nErrCode := FT_FLOPTST( Asc( Upper( cArg1 ) ) - Asc( "A" ) )
OutStd( "Return Code is " + LTrim( Str( nErrCode ) ) + hb_eol() )
OutStd( "Return Code is " + hb_ntos( nErrCode ) + hb_eol() )
ELSE
OutStd( "Usage: floptst cDrive" + hb_eol() + " where cDrive is 'A' or 'B' etc..." + hb_eol() )
ENDIF

View File

@@ -71,8 +71,8 @@ FUNCTION FT_MIN2MIL( nMIN )
nMIN := nMIN % 1440
RETURN Right( "00" + LTrim( Str( Int( nMIN / 60 ) ) ), 2 ) + ;
Right( "00" + LTrim( Str( Int( nMIN % 60 ) ) ), 2 )
RETURN Right( "00" + hb_ntos( Int( nMIN / 60 ) ), 2 ) + ;
Right( "00" + hb_ntos( Int( nMIN % 60 ) ), 2 )
FUNCTION FT_MIL2CIV( cMILTIME )
@@ -94,12 +94,12 @@ FUNCTION FT_MIL2CIV( cMILTIME )
IF nHRS == 0
cHRS := "12"
ELSE
cHRS := Right( " " + LTrim( Str( Int( nHRS ) ) ), 2 )
cHRS := Right( " " + hb_ntos( Int( nHRS ) ), 2 )
ENDIF
cCIVTIME := cHRS + ":" + cMINS + " am"
OTHERWISE // PM
cCIVTIME := Right( " " + LTrim( Str( Int( nHRS - 12 ) ) ), 2 ) + ;
cCIVTIME := Right( " " + hb_ntos( Int( nHRS - 12 ) ), 2 ) + ;
":" + cMINS + " pm"
ENDCASE
@@ -134,10 +134,10 @@ FUNCTION FT_CIV2MIL( cTIME )
cMILTIME := " "
ENDIF
CASE Upper( cKEY ) == "A" // am
cMILTIME := Right( "00" + LTrim( Str( Val( Left( cTIME, 2 ) ) ) ), 2 ) + ;
cMILTIME := Right( "00" + hb_ntos( Val( Left( cTIME, 2 ) ) ), 2 ) + ;
SubStr( cTIME, 4, 2 )
CASE Upper( cKEY ) == "P" // pm
cMILTIME := Right( "00" + LTrim( Str( Val( Left( cTIME, 2 ) ) + 12 ) ), 2 ) + ;
cMILTIME := Right( "00" + hb_ntos( Val( Left( cTIME, 2 ) ) + 12 ), 2 ) + ;
SubStr( cTIME, 4, 2 )
OTHERWISE
cMILTIME := " " // error

View File

@@ -28,11 +28,7 @@
*/
FUNCTION FT_MIN2DHM( nMINS )
LOCAL aDHM_[ 3 ]
aDHM_[ 1 ] := LTrim( ( Str( Int( nMINS / 1440 ) ) ) )
aDHM_[ 2 ] := LTrim( Str( Int( ( nMINS % 1440 ) / 60 ) ) )
aDHM_[ 3 ] := LTrim( Str( Int( ( nMINS % 1440 ) % 60 ) ) )
RETURN aDHM_
RETURN {;
hb_ntos( Int( nMINS / 1440 ) ) ,;
hb_ntos( Int( ( nMINS % 1440 ) / 60 ) ) ,;
hb_ntos( Int( ( nMINS % 1440 ) % 60 ) ) }

View File

@@ -53,12 +53,12 @@ PROCEDURE Main( nRow, nCol )
SetColor( "GR+/RB" )
// ..... Start the demo
// ..... Start the demo
@MaxRow(), 0 SAY "Driver version: " + ;
AllTrim( Str( FT_MVERSION(@nMinor,@nType,@nIRQ ),2,0 ) ) + "." + ;
AllTrim( Str( nMinor,2,0 ) )
@ Row(), Col() SAY " " + aType[nType] + " mouse using IRQ " + Str( nIRQ, 1, 0 )
AllTrim( Str( FT_MVERSION( @nMinor, @nType, @nIRQ ), 2, 0 ) ) + "." + ;
AllTrim( Str( nMinor, 2, 0 ) )
@ Row(), Col() SAY " " + aType[ nType ] + " mouse using IRQ " + Str( nIRQ, 1, 0 )
FT_MGETSENS( @nHoriz, @nVert, @nDouble ) // Get the current sensitivities
FT_MSETSENS( 70, 70, 60 ) // Bump up the sensitivity of the mouse
@@ -66,7 +66,7 @@ PROCEDURE Main( nRow, nCol )
FT_MSHOWCRS()
FT_MSETCOORD( 10, 20 ) // just an arbitrary place for demo
// put the unchanging stuff
// put the unchanging stuff
DevPos( 9, 10 )
DevOut( "FT_MMICKEYS :" )

View File

@@ -127,9 +127,9 @@ PROCEDURE Main( nRow, nCol )
// ..... Start the demo
@MaxRow(), 0 SAY "Driver version: " + ;
AllTrim( Str( FT_MVERSION(@nMinor,@nType,@nIRQ ),2,0 ) ) + "." + ;
AllTrim( Str( nMinor,2,0 ) )
@ Row(), Col() SAY " " + aType[nType] + " mouse using IRQ " + Str( nIRQ, 1, 0 )
AllTrim( Str( FT_MVERSION( @nMinor, @nType, @nIRQ ), 2, 0 ) ) + "." + ;
AllTrim( Str( nMinor, 2, 0 ) )
@ Row(), Col() SAY " " + aType[ nType ] + " mouse using IRQ " + Str( nIRQ, 1, 0 )
FT_MGETSENS( @nHoriz, @nVert, @nDouble ) // Get the current sensitivities
FT_MSETSENS( 70, 70, 60 ) // Bump up the sensitivity of the mouse

View File

@@ -80,9 +80,9 @@ PROCEDURE Main()
ft_nwSemEx( nHandle, @nValue, @nOpenCnt )
WHILE .T.
@ 23, 0 SAY "Semaphore test -> Open at [" + ;
AllTrim( Str( nOpenCnt ) ) + ;
hb_ntos( nOpenCnt ) + ;
"] stations, value is [" + ;
AllTrim( Str( nValue ) ) + "]"
hb_ntos( nValue ) + "]"
IF Inkey( WAIT_SECONDS ) != 0
EXIT

View File

@@ -469,7 +469,7 @@ STATIC FUNCTION _ftDispTotal( aAdder )
LOCAL cTotStr
IF nTotal > Val( _ftCharRem( ",", cTotPict ) )
cTotStr := _ftStuffComma( LTrim( Str( nTotal ) ) )
cTotStr := _ftStuffComma( hb_ntos( nTotal ) )
@ 4 + nTopOS, 8 + nAddSpace SAY "**** ERROR **** "
_ftError( "that number is to big to display! I believe the answer was " + ;
cTotStr + "." )
@@ -503,7 +503,7 @@ STATIC FUNCTION _ftDispSubTot( aAdder )
LOCAL cStotStr
IF nNumTotal > Val( _ftCharRem( ",", cTotPict ) )
cStotStr := _ftStuffComma( LTrim( Str( nNumTotal ) ) )
cStotStr := _ftStuffComma( hb_ntos( nNumTotal ) )
@ 4 + nTopOS, 8 + nAddSpace SAY "**** ERROR **** "
_ftError( "that number is to big to display! I believe the answer was " + ;
cStotStr + "." )