19991007-02:57 GMT+1

This commit is contained in:
Viktor Szakats
1999-10-07 01:14:02 +00:00
parent 0f9e96c5ad
commit 82292020f6
7 changed files with 86 additions and 34 deletions

View File

@@ -1,3 +1,20 @@
19991007-02:57 GMT+1 Victor Szel <info@szelvesz.hu>
* include/filesys.h
source/rtl/filesys.c
! UINT_MAX changed to USHORT_MAX
* source/tools/fileread.prg
+ "s_" prefix added to STATIC variable name.
* source/rdd/dbcmd.c
! RDDSETDEFAULT() now throws an error if a non-existing RDD name
is passed. Like in Clipper.
+ TOFIX: added about directly modified hb_parc() buffers.
* source/rtl/tget.prg
! Mistyped object variable names corrected.
! :display now leaves to cursor at a Clipper compatible position.
Cursor is positioned explicitly after internal :display calls.
* source/rtl/tgetlist.prg
+ missing DateMsg() method added.
19991006-20:20 EDT Paul Tucker <ptucker@sympatico.ca>
* makefile.vc
* changed mainstd.c to main.c

View File

@@ -96,7 +96,7 @@ extern void hb_fsSetDevMode ( FHANDLE hFileHandle, USHORT uiDevMode );
extern void hb_fsSetError ( USHORT uiError );
extern USHORT hb_fsWrite ( FHANDLE hFileHandle, BYTE * pBuff, USHORT ulCount );
#if UINT_MAX == ULONG_MAX
#if USHORT_MAX == ULONG_MAX
/* NOTE: hb_fsRead/hb_fsWrite can work with ULONG data blocks */
#define hb_fsReadLarge hb_fsRead
#define hb_fsWriteLarge hb_fsWrite

View File

@@ -1093,7 +1093,7 @@ HARBOUR HB_DBCREATE( void )
hb_rddCheck();
szDriver = hb_parc( 3 );
if( ( uiLen = strlen( szDriver ) ) > 0 )
hb_strUpper( szDriver, uiLen );
hb_strUpper( szDriver, uiLen ); /* TOFIX: Direct access to hb_parc() buffer ! */
else
szDriver = szDefDriver;
@@ -1438,7 +1438,7 @@ HARBOUR HB_DBUSEAREA( void )
hb_rddCheck();
szDriver = hb_parc( 2 );
if( ( uiLen = strlen( szDriver ) ) > 0 )
hb_strUpper( szDriver, uiLen );
hb_strUpper( szDriver, uiLen ); /* TOFIX: Direct access to hb_parc() buffer ! */
else
szDriver = szDefDriver;
@@ -1649,7 +1649,7 @@ HARBOUR HB_FIELDPOS( void )
if( pCurrArea )
{
szName = hb_parc( 1 );
hb_strUpper( szName, strlen( szName ) );
hb_strUpper( szName, strlen( szName ) ); /* TOFIX: Direct access to hb_parc() buffer ! */
uiCount = 0;
pField = ( ( AREAP ) pCurrArea->pArea )->lpFields;
while( pField )
@@ -1811,7 +1811,7 @@ HARBOUR HB_RDDREGISTER( void )
szDriver = hb_parc( 1 );
if( ( uiLen = strlen( szDriver ) ) > 0 )
{
hb_strUpper( szDriver, uiLen );
hb_strUpper( szDriver, uiLen ); /* TOFIX: Direct access to hb_parc() buffer ! */
/*
* hb_rddRegister returns:
*
@@ -1835,7 +1835,14 @@ HARBOUR HB_RDDSETDEFAULT( void )
szNewDriver = hb_parc( 1 );
if( ( uiLen = strlen( szNewDriver ) ) > 0 )
{
hb_strUpper( szNewDriver, uiLen );
hb_strUpper( szNewDriver, uiLen ); /* TOFIX: Direct access to hb_parc() buffer ! */
if( !hb_rddFindNode( szNewDriver, NULL ) )
{
hb_errRT_DBCMD( EG_ARG, 1015, NULL, "RDDSETDEFAULT" );
return;
}
szDefDriver = ( char * ) hb_xrealloc( szDefDriver, uiLen + 1 );
strcpy( szDefDriver, szNewDriver );
}

View File

@@ -196,8 +196,6 @@ static USHORT s_uiErrorLast = 0;
#define PATH_MAX 256
#endif
#define LARGE_MAX ( USHRT_MAX - 1L )
extern int rename( const char *, const char * );
/* Convert HARBOUR flags to IO subsystem flags */
@@ -519,7 +517,9 @@ USHORT hb_fsWrite( FHANDLE hFileHandle, BYTE * pBuff, USHORT uiCount )
return uiWritten;
}
#if UINT_MAX != ULONG_MAX
#if USHORT_MAX != ULONG_MAX
#define LARGE_MAX ( USHRT_MAX - 1L )
ULONG hb_fsReadLarge( FHANDLE hFileHandle, BYTE * pBuff, ULONG ulCount )
{

View File

@@ -200,7 +200,6 @@ METHOD Display() CLASS TGet
local nOldCursor := SetCursor( 0 )
@ ::Row, ::Col SAY ::buffer COLOR cClrInverse
SetPos( ::Row, ::Col + If( ::Pos != nil, ::Pos - 1, 0 ) )
SetCursor( nOldCursor )
return Self
@@ -415,6 +414,7 @@ METHOD overstrike(cChar) CLASS TGet
endif
::Display()
SetPos( ::Row, ::Col + If( ::Pos != nil, ::Pos - 1, 0 ) )
return Self
@@ -456,6 +456,7 @@ METHOD Insert(cChar) CLASS TGet
endif
::Display() // Kwon,Oh-Chul
SetPos( ::Row, ::Col + If( ::Pos != nil, ::Pos - 1, 0 ) )
return Self
@@ -749,6 +750,7 @@ METHOD _Delete() CLASS TGet
::Assign()
::Display()
SetPos( ::Row, ::Col + If( ::Pos != nil, ::Pos - 1, 0 ) )
return Self
@@ -791,8 +793,8 @@ function _GET_( uVar, cVarName, cPicture, bValid, bWhen, bSetGet )
uVar := uVar // Suppress unused variable warning
oGet:bPreBlock := bWhen
oGet:bPostBlock := bValid
oGet:PreBlock := bWhen
oGet:PostBlock := bValid
return oGet

View File

@@ -103,6 +103,7 @@ CLASS TGetList
METHOD SetFormat( bFormat )
METHOD KillRead()
METHOD GetActive( oGet )
METHOD DateMsg()
METHOD ShowScoreBoard()
METHOD ReadVar( cNewVarName )
METHOD ReadExit( lNew ) INLINE Set( _SET_EXIT, lNew )
@@ -486,6 +487,31 @@ METHOD ShowScoreboard() CLASS TGetList
return nil
METHOD DateMsg() CLASS TGetList
local nRow
local nCol
if Set( _SET_SCOREBOARD )
nRow := Row()
nCol := Col()
SetPos( SCORE_ROW, SCORE_COL )
DispOut( "Invalid date" )
SetPos( nRow, nCol )
do while NextKey() == 0
enddo
SetPos( SCORE_ROW, SCORE_COL )
DispOut( Space( Len( "Invalid date" ) ) )
SetPos( nRow, nCol )
endif
return nil
METHOD ReadVar( cNewVarName ) CLASS TGetList
local cOldName := ::cVarName

View File

@@ -125,33 +125,33 @@
*/
FUNCTION TFileRead()
STATIC oClass
STATIC s_oClass
IF oClass == NIL
oClass := TClass():New( "TFile" ) // New class
oClass:AddClassData( "cFile" ) // The filename
oClass:AddClassData( "nHan" ) // The open file handle
oClass:AddClassData( "lEOF" ) // The end of file reached flag
oClass:AddClassData( "nError" ) // The current file error code
oClass:AddClassData( "nLastOp" ) // The last operation done (for error messages)
oClass:AddClassData( "cBuffer" ) // The readahead buffer
oClass:AddClassData( "nReadSize" ) // How much to add to the readahead buffer on
IF s_oClass == NIL
s_oClass := TClass():New( "TFile" ) // New class
s_oClass:AddClassData( "cFile" ) // The filename
s_oClass:AddClassData( "nHan" ) // The open file handle
s_oClass:AddClassData( "lEOF" ) // The end of file reached flag
s_oClass:AddClassData( "nError" ) // The current file error code
s_oClass:AddClassData( "nLastOp" ) // The last operation done (for error messages)
s_oClass:AddClassData( "cBuffer" ) // The readahead buffer
s_oClass:AddClassData( "nReadSize" ) // How much to add to the readahead buffer on
// each read from the file
oClass:AddMethod( "New", @f_new() ) // Create a new class instance
oClass:AddMethod( "Open", @f_open() ) // Open the file for reading
oClass:AddMethod( "Close", @f_close() ) // Close the file when done
oClass:AddMethod( "ReadLine", @f_read() ) // Read a line from the file
oClass:AddMethod( "Name", @f_name() ) // Retunrs the file name
oClass:AddMethod( "IsOpen", @f_is_open() ) // Returns .T. if file is open
oClass:AddMethod( "MoreToRead", @f_more() ) // Returns .T. if more to be read
oClass:AddMethod( "Error", @f_error() ) // Returns .T. if error occurred
oClass:AddMethod( "ErrorNo", @f_error_no() ) // Returns current error code
oClass:AddMethod( "ErrorMsg", @f_error_msg() ) // Returns formatted error message
oClass:Create()
s_oClass:AddMethod( "New", @f_new() ) // Create a new class instance
s_oClass:AddMethod( "Open", @f_open() ) // Open the file for reading
s_oClass:AddMethod( "Close", @f_close() ) // Close the file when done
s_oClass:AddMethod( "ReadLine", @f_read() ) // Read a line from the file
s_oClass:AddMethod( "Name", @f_name() ) // Retunrs the file name
s_oClass:AddMethod( "IsOpen", @f_is_open() ) // Returns .T. if file is open
s_oClass:AddMethod( "MoreToRead", @f_more() ) // Returns .T. if more to be read
s_oClass:AddMethod( "Error", @f_error() ) // Returns .T. if error occurred
s_oClass:AddMethod( "ErrorNo", @f_error_no() ) // Returns current error code
s_oClass:AddMethod( "ErrorMsg", @f_error_msg() ) // Returns formatted error message
s_oClass:Create()
END IF
RETURN oClass:Instance()
RETURN s_oClass:Instance()
STATIC FUNCTION f_new( cFile, nSize )
LOCAL oSelf := Qself()