2008-10-06 01:06 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* source/debug/debugger.prg
* source/rtl/typefile.prg
* source/rtl/tgetlist.prg
* source/rtl/treport.prg
* source/rtl/teditor.prg
* Using [Q]QOut() functions instead of "[?]?" commands.
* Using hb_Run() function instead of RUN command.
* source/rtl/typefile.prg
% Upped read buffer.
* Formatting.
% Got rid of a few unnecessary initialization.
This commit is contained in:
@@ -8,6 +8,20 @@
|
||||
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
|
||||
*/
|
||||
|
||||
2008-10-06 01:06 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
|
||||
* source/debug/debugger.prg
|
||||
* source/rtl/typefile.prg
|
||||
* source/rtl/tgetlist.prg
|
||||
* source/rtl/treport.prg
|
||||
* source/rtl/teditor.prg
|
||||
* Using [Q]QOut() functions instead of "[?]?" commands.
|
||||
* Using hb_Run() function instead of RUN command.
|
||||
|
||||
* source/rtl/typefile.prg
|
||||
% Upped read buffer.
|
||||
* Formatting.
|
||||
% Got rid of a few unnecessary initialization.
|
||||
|
||||
2008-10-06 00:28 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
|
||||
* include/hbthread.h
|
||||
! Blind fix for WinCE compilation after MT changes.
|
||||
|
||||
@@ -2034,17 +2034,21 @@ METHOD OSShell() CLASS HBDebugger
|
||||
|
||||
SetColor( "W/N" )
|
||||
CLS
|
||||
? "Type 'exit' to RETURN to the Debugger"
|
||||
QOut( "Type 'exit' to RETURN to the Debugger" )
|
||||
SetCursor( SC_NORMAL )
|
||||
|
||||
BEGIN SEQUENCE WITH { | objErr | Break( objErr ) }
|
||||
|
||||
IF At( "WINDOWS", cOs ) != 0 .OR. At( "DOS", cOs ) != 0 .OR. At( "OS/2", cOs ) != 0
|
||||
IF At( "WINDOWS", cOs ) != 0 .OR. ;
|
||||
At( "DOS", cOs ) != 0 .OR. ;
|
||||
At( "OS/2", cOs ) != 0
|
||||
cShell := GetEnv( "COMSPEC" )
|
||||
RUN ( cShell )
|
||||
ELSEIF At( "LINUX", cOs ) != 0 .OR. At( "BSD", cOs ) != 0 .OR. At( "DARWIN", cOs ) != 0
|
||||
hb_Run( cShell )
|
||||
ELSEIF At( "LINUX", cOs ) != 0 .OR. ;
|
||||
At( "BSD", cOs ) != 0 .OR. ;
|
||||
At( "DARWIN", cOs ) != 0
|
||||
cShell := GetEnv( "SHELL" )
|
||||
RUN ( cShell )
|
||||
hb_Run( cShell )
|
||||
ELSE
|
||||
Alert( "Not implemented yet!" )
|
||||
ENDIF
|
||||
|
||||
@@ -635,7 +635,7 @@ METHOD InsertState( lInsState ) CLASS HBEditor
|
||||
|
||||
IF ISLOGICAL( lInsState )
|
||||
::lInsert := lInsState
|
||||
SET( _SET_INSERT, lInsState )
|
||||
Set( _SET_INSERT, lInsState )
|
||||
ENDIF
|
||||
|
||||
RETURN Self
|
||||
|
||||
@@ -508,7 +508,7 @@ METHOD GetApplyKey( nKey, oGet, oMenu, aMsg ) CLASS HBGetList
|
||||
|
||||
IF oGet:typeOut
|
||||
IF Set( _SET_BELL )
|
||||
?? Chr( 7 )
|
||||
QQOut( Chr( 7 ) )
|
||||
ENDIF
|
||||
IF ! Set( _SET_CONFIRM )
|
||||
oGet:exitState := GE_ENTER
|
||||
|
||||
@@ -587,13 +587,12 @@ METHOD ExecuteReport() CLASS HBReportForm
|
||||
IF !::lFirstPass // Don't bother first time through
|
||||
|
||||
// Make a pass through all the groups
|
||||
FOR nGroup := Len(::aReportData[RPT_GROUPS]) TO 1 STEP -1
|
||||
|
||||
FOR nGroup := Len( ::aReportData[ RPT_GROUPS ] ) TO 1 STEP -1
|
||||
|
||||
// make sure group has subtotals
|
||||
lAnySubTotals := .F.
|
||||
FOR nCol := 1 TO Len(::aReportData[RPT_COLUMNS])
|
||||
IF ::aReportData[RPT_COLUMNS,nCol,RCT_TOTAL]
|
||||
FOR nCol := 1 TO Len( ::aReportData[ RPT_COLUMNS ] )
|
||||
IF ::aReportData[ RPT_COLUMNS, nCol, RCT_TOTAL ]
|
||||
lAnySubTotals := .T.
|
||||
EXIT // NOTE
|
||||
ENDIF
|
||||
@@ -615,34 +614,34 @@ METHOD ExecuteReport() CLASS HBReportForm
|
||||
ENDIF
|
||||
|
||||
// If this (sub)group has changed since the last record
|
||||
IF lGroupChanged .OR. MakeAStr(Eval(::aReportData[RPT_GROUPS,nGroup,RGT_EXP]),;
|
||||
::aReportData[RPT_GROUPS,nGroup,RGT_TYPE]) != ::aGroupTotals[nGroup]
|
||||
IF lGroupChanged .OR. MakeAStr( Eval( ::aReportData[ RPT_GROUPS, nGroup, RGT_EXP ] ),;
|
||||
::aReportData[ RPT_GROUPS, nGroup, RGT_TYPE ] ) != ::aGroupTotals[ nGroup ]
|
||||
|
||||
AAdd( aRecordHeader, iif( nGroup == 1, __NatMsg(_RFRM_SUBTOTAL),;
|
||||
__NatMsg(_RFRM_SUBSUBTOTAL) ) )
|
||||
AAdd( aRecordHeader, iif( nGroup == 1, __NatMsg( _RFRM_SUBTOTAL ),;
|
||||
__NatMsg( _RFRM_SUBSUBTOTAL ) ) )
|
||||
AAdd( aRecordHeader, "" )
|
||||
|
||||
|
||||
// Cycle through the columns, adding either the group
|
||||
// amount from ::aReportTotals or spaces wide enough for
|
||||
// the non-totaled columns
|
||||
FOR nCol := 1 TO Len(::aReportData[RPT_COLUMNS])
|
||||
IF ::aReportData[RPT_COLUMNS,nCol,RCT_TOTAL]
|
||||
aRecordHeader[ Len(aRecordHeader) ] += ;
|
||||
Transform(::aReportTotals[nGroup+1,nCol], ;
|
||||
::aReportData[RPT_COLUMNS,nCol,RCT_PICT])
|
||||
FOR nCol := 1 TO Len( ::aReportData[ RPT_COLUMNS ] )
|
||||
IF ::aReportData[ RPT_COLUMNS, nCol, RCT_TOTAL ]
|
||||
aRecordHeader[ Len( aRecordHeader ) ] += ;
|
||||
Transform( ::aReportTotals[ nGroup + 1, nCol ], ;
|
||||
::aReportData[ RPT_COLUMNS, nCol, RCT_PICT ] )
|
||||
// Zero out the group totals column from aReportTotals
|
||||
::aReportTotals[nGroup+1,nCol] := 0
|
||||
::aReportTotals[ nGroup + 1, nCol ] := 0
|
||||
ELSE
|
||||
aRecordHeader[ Len(aRecordHeader) ] += ;
|
||||
Space(::aReportData[RPT_COLUMNS,nCol,RCT_WIDTH])
|
||||
aRecordHeader[ Len( aRecordHeader ) ] += ;
|
||||
Space( ::aReportData[ RPT_COLUMNS, nCol, RCT_WIDTH ] )
|
||||
ENDIF
|
||||
aRecordHeader[ Len(aRecordHeader) ] += " "
|
||||
aRecordHeader[ Len( aRecordHeader ) ] += " "
|
||||
NEXT
|
||||
// Get rid of the extra space from the last column
|
||||
aRecordHeader[Len(aRecordHeader)] := ;
|
||||
LEFT( aRecordHeader[Len(aRecordHeader)], ;
|
||||
Len(aRecordHeader[Len(aRecordHeader)]) - 1 )
|
||||
aRecordHeader[ Len( aRecordHeader ) ] := ;
|
||||
Left( aRecordHeader[ Len( aRecordHeader ) ], ;
|
||||
Len( aRecordHeader[ Len( aRecordHeader ) ] ) - 1 )
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
|
||||
@@ -54,19 +54,30 @@
|
||||
#include "error.ch"
|
||||
#include "fileio.ch"
|
||||
|
||||
#define BUFFER_LENGTH 2048
|
||||
#define BUFFER_LENGTH 8192
|
||||
|
||||
PROCEDURE __TypeFile( cFile, lPrint )
|
||||
LOCAL nHandle, cBuffer, nRead := 0, nHasRead := 0, nSize := 0, nBuffer
|
||||
LOCAL oErr, xRecover, nRetries
|
||||
LOCAL aSaveSet[ 2 ]
|
||||
LOCAL cDir, cName, cExt, cTmp, aPath, i
|
||||
|
||||
IF !ISLOGICAL( lPrint )
|
||||
LOCAL nHandle
|
||||
LOCAL cBuffer
|
||||
LOCAL nRead
|
||||
LOCAL nHasRead
|
||||
LOCAL nSize
|
||||
LOCAL nBuffer
|
||||
LOCAL oErr
|
||||
LOCAL xRecover
|
||||
LOCAL nRetries
|
||||
LOCAL aSaveSet[ 2 ]
|
||||
LOCAL cDir, cName, cExt
|
||||
LOCAL cTmp
|
||||
LOCAL aPath
|
||||
LOCAL i
|
||||
|
||||
IF ! ISLOGICAL( lPrint )
|
||||
lPrint := .F.
|
||||
ENDIF
|
||||
|
||||
IF !ISCHARACTER( cFile )
|
||||
IF ! ISCHARACTER( cFile )
|
||||
oErr := ErrorNew()
|
||||
oErr:severity := ES_ERROR
|
||||
oErr:genCode := EG_OPEN
|
||||
@@ -76,18 +87,18 @@ PROCEDURE __TypeFile( cFile, lPrint )
|
||||
Eval( ErrorBlock(), oErr )
|
||||
ENDIF
|
||||
|
||||
// If no drive/dir specified, search the SET DEFAULT and PATH directories
|
||||
/* If no drive/dir specified, search the SET DEFAULT and PATH directories */
|
||||
|
||||
hb_FNameSplit( cFile, @cDir, @cName, @cExt )
|
||||
IF Empty( cDir )
|
||||
cTmp := SET( _SET_DEFAULT ) + ";" + SET( _SET_PATH )
|
||||
cTmp := Set( _SET_DEFAULT ) + ";" + Set( _SET_PATH )
|
||||
cTmp := StrTran( cTmp, ",", ";" )
|
||||
i := Len( cTmp )
|
||||
DO WHILE SubStr( cTmp, i, 1 ) == ";" // remove last ";"
|
||||
cTmp := LEFT( cTmp, --i )
|
||||
DO WHILE SubStr( cTmp, i, 1 ) == ";" /* remove last ";" */
|
||||
cTmp := Left( cTmp, --i )
|
||||
ENDDO
|
||||
aPath := HB_ATOKENS( cTmp, ";" )
|
||||
FOR i := 1 TO len( aPath )
|
||||
aPath := hb_ATokens( cTmp, ";" )
|
||||
FOR i := 1 TO Len( aPath )
|
||||
IF File( cTmp := hb_FNameMerge( aPath[ i ], cName, cExt ) )
|
||||
cFile := cTmp
|
||||
EXIT
|
||||
@@ -108,13 +119,13 @@ PROCEDURE __TypeFile( cFile, lPrint )
|
||||
oErr:OsCode := FError()
|
||||
oErr:tries := ++nRetries
|
||||
xRecover := Eval( ErrorBlock(), oErr )
|
||||
IF ISLOGICAL( xRecover ) .AND. !xRecover // user select "Default"
|
||||
IF ISLOGICAL( xRecover ) .AND. !xRecover /* user select "Default" */
|
||||
RETURN
|
||||
ENDIF
|
||||
ENDDO
|
||||
|
||||
// NOTE: the NG say you should explicitly SET CONSOLE OFF if you wish to
|
||||
// suppress output to screen. [ckedem]
|
||||
/* NOTE: the NG say you should explicitly SET CONSOLE OFF if you wish to
|
||||
suppress output to screen. [ckedem] */
|
||||
|
||||
IF lPrint
|
||||
aSaveSet[ 1 ] := Set( _SET_DEVICE, "PRINTER" )
|
||||
@@ -125,16 +136,19 @@ PROCEDURE __TypeFile( cFile, lPrint )
|
||||
nBuffer := Min( nSize, BUFFER_LENGTH )
|
||||
|
||||
FSeek( nHandle, 0 ) // go top
|
||||
// here we try to read a line at a time but I think we could just
|
||||
// display the whole buffer since it said: "without any headings or formating"
|
||||
|
||||
cbuffer := Space( nBuffer )
|
||||
? // start in a new line
|
||||
DO WHILE ( nRead := fread( nHandle, @cbuffer, nBuffer )) > 0
|
||||
/* Here we try to read a line at a time but I think we could just
|
||||
display the whole buffer since it said:
|
||||
"without any headings or formating" */
|
||||
|
||||
nHasRead := 0
|
||||
cBuffer := Space( nBuffer )
|
||||
QOut() /* starting a new line */
|
||||
DO WHILE ( nRead := FRead( nHandle, @cBuffer, nBuffer ) ) > 0
|
||||
nHasRead += nRead
|
||||
?? cBuffer
|
||||
QQOut( cBuffer )
|
||||
nBuffer := Min( nSize - nHasRead, nBuffer )
|
||||
cbuffer := Space( nBuffer )
|
||||
cBuffer := Space( nBuffer )
|
||||
ENDDO
|
||||
|
||||
FClose( nHandle )
|
||||
|
||||
Reference in New Issue
Block a user