From f67b46146bd4d64ab6a36f7235a4de02fb688e2c Mon Sep 17 00:00:00 2001 From: Ryszard Glab Date: Mon, 26 Jul 1999 00:53:50 +0000 Subject: [PATCH] ChangeLog 19990726-02:30 --- harbour/ChangeLog | 96 +++++++++++++ harbour/include/error.ch | 6 + harbour/include/errorapi.h | 2 + harbour/include/extend.h | 5 +- harbour/include/hberrors.h | 23 ++-- harbour/source/compiler/harbour.y | 193 +++++++++++++++++++++++---- harbour/source/hbpp/table.c | 22 +-- harbour/source/rdd/Makefile | 10 +- harbour/source/rtl/arrays.c | 84 ++++-------- harbour/source/rtl/classes.c | 33 ++--- harbour/source/rtl/copyfile.c | 8 +- harbour/source/rtl/dates.c | 28 ++-- harbour/source/rtl/errorapi.c | 15 ++- harbour/source/rtl/gtxxx.c | 2 + harbour/source/rtl/math.c | 34 ++--- harbour/source/rtl/memvars.c | 25 ++-- harbour/source/rtl/msgxxx.c | 2 + harbour/source/rtl/natmsg/msgbas.c | 62 +++++++++ harbour/source/rtl/natmsg/msgcat.c | 62 +++++++++ harbour/source/rtl/natmsg/msgcz852.c | 62 +++++++++ harbour/source/rtl/natmsg/msgczkam.c | 62 +++++++++ harbour/source/rtl/natmsg/msgdut.c | 62 +++++++++ harbour/source/rtl/natmsg/msgeo.c | 62 +++++++++ harbour/source/rtl/natmsg/msgfre.c | 62 +++++++++ harbour/source/rtl/natmsg/msggal.c | 62 +++++++++ harbour/source/rtl/natmsg/msgger.c | 62 +++++++++ harbour/source/rtl/natmsg/msghu.c | 62 +++++++++ harbour/source/rtl/natmsg/msgia.c | 62 +++++++++ harbour/source/rtl/natmsg/msgita.c | 62 +++++++++ harbour/source/rtl/natmsg/msgkor.c | 64 ++++++++- harbour/source/rtl/natmsg/msgpl852.c | 63 ++++++++- harbour/source/rtl/natmsg/msgpliso.c | 79 +++++++++++ harbour/source/rtl/natmsg/msgplmaz.c | 65 ++++++++- harbour/source/rtl/natmsg/msgpor.c | 61 +++++++++ harbour/source/rtl/natmsg/msgr1251.c | 62 +++++++++ harbour/source/rtl/natmsg/msgru866.c | 62 +++++++++ harbour/source/rtl/natmsg/msgspa.c | 61 +++++++++ harbour/source/rtl/natmsg/msguk.c | 62 +++++++++ harbour/source/rtl/natmsg/msgyu852.c | 62 +++++++++ harbour/source/rtl/set.c | 12 +- harbour/source/rtl/strings.c | 62 ++++----- harbour/source/rtl/transfrm.c | 4 +- harbour/source/tools/dates2.c | 6 +- harbour/source/vm/hvm.c | 44 +++--- harbour/tests/working/Makefile | 1 + 45 files changed, 1843 insertions(+), 259 deletions(-) create mode 100644 harbour/source/rtl/natmsg/msgpliso.c diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0a9c05ed4e..e8234b74cb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,99 @@ +19990726-02:30 GMT+2 Ryszard Glab + + *include/errorapi.h + + added declaration of hb_ErrorNatDescription() function -this + function should be used to read a description of generic errors + + *source/rtl/errorapi.c + * changed to read a generic error description form national + language module: + hb_errorRT_BASE(), hb_errorRT_TERMINAL(), hb_errorRT_DBCM() calls + hb_ErrorNatDescription() when there is no description specified + in function that generates an error + + *include/error.ch + * new generic error codes: + EG_ARGCOUNT Incorrect number of arguments + EG_ARRACCESS array access + EG_ARRASSIGN array assign + EG_NOTARRAY not an array + EG_CONDITION conditional + + *source/rtl/natmsg/msgbas.c + *source/rtl/natmsg/msgcat.c + *source/rtl/natmsg/msgcz852.c + *source/rtl/natmsg/msgczkam.c + *source/rtl/natmsg/msgdut.c + *source/rtl/natmsg/msgeo.c + *source/rtl/natmsg/msgfre.c + *source/rtl/natmsg/msggal.c + *source/rtl/natmsg/msgger.c + *source/rtl/natmsg/msghu.c + *source/rtl/natmsg/msgia.c + *source/rtl/natmsg/msgita.c + *source/rtl/natmsg/msgkor.c + *source/rtl/natmsg/msgpl852.c + *source/rtl/natmsg/msgplmaz.c + *source/rtl/natmsg/msgpor.c + *source/rtl/natmsg/msgr1251.c + *source/rtl/natmsg/msgru866.c + *source/rtl/natmsg/msgspa.c + *source/rtl/natmsg/msguk.c + *source/rtl/natmsg/msgyu852.c + + the table with generic errors' descriptions was added + + new hb_ErrorNatDescription() that returns error description + + *source/rtl/natmsg/msgpliso.c + + new module for Polish ISO-8859-2 coding + + *source/rtl/arrays.c + *source/rtl/copyfile.c + *source/rtl/classes.c + *source/rtl/dates.c + *source/rtl/math.c + *source/rtl/set.c + *source/rtl/strings.c + *source/rtl/transfrm.c + *source/rtl/memvar.c + *source/rtl/rdd/dbcmd.c + *source/tools/dates2.c + *source/vm/hvm.c + * changed to use generic error codes (EG_*) instead of hard-coded + descriptions + + *source/rdd/Makefile + *corrected to compile files placed in this directory + + *tests/working/Makefile + + added rdd library + + *source/rtl/gtxxx.c + + added #include "hbsetup.h" to properly include platform specific + files based on settings in hbsetup.h + + *source/rtl/msgxxx.c + + added #include "hbsetup.h" to properly include platform specific + files based on settings in hbsetup.h + +added #include "hbdefs.h" + + *source/compiler/harbour.y + + added support for '-a' automatic MEMVAR declaration + * extended support for MEMVAR declaration + + added definition of VS_PRIVATE and VS_PUBLIC + + *include/hberror.h + + new warning code WARN_MEMVAR_ASSUMED + + *include/extend.h + - removed definition of VS_PRIVATE and VS_PUBLIC + + *source/rtl/memvars.c + + added definition of VS_PRIVATE and VS_PUBLIC + + *source/hbpp/table.c + * changed names for memvar related functions ('__MV' prefix) + in RELEASE, CLEAR* and SAVE/RESTORE commands + 19990725-23:12 CET Victor Szel + make_tpl.bat Template batch file to call the GNU make system. diff --git a/harbour/include/error.ch b/harbour/include/error.ch index fe03447277..e6d32cefe1 100644 --- a/harbour/include/error.ch +++ b/harbour/include/error.ch @@ -52,4 +52,10 @@ #define EG_APPENDLOCK 40 #define EG_LOCK 41 +#define EG_ARGCOUNT 45 +#define EG_ARRACCESS 46 +#define EG_ARRASSIGN 47 +#define EG_NOTARRAY 48 +#define EG_CONDITION 49 + #endif /* _ERROR_CH */ diff --git a/harbour/include/errorapi.h b/harbour/include/errorapi.h index c111d698c2..4296dd80dc 100644 --- a/harbour/include/errorapi.h +++ b/harbour/include/errorapi.h @@ -102,6 +102,8 @@ WORD hb_errorRT_DBCMD( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, c /* TODO: Enable this: void hb_errorInternal( ULONG ulCode ); */ +/* Reads error description in national language */ +char *hb_ErrorNatDescription( ULONG ulGenCode ); #endif /* HB_ERRORAPI_H_ */ diff --git a/harbour/include/extend.h b/harbour/include/extend.h index 80164ce5f7..ed0196bf1c 100644 --- a/harbour/include/extend.h +++ b/harbour/include/extend.h @@ -48,10 +48,7 @@ typedef struct /* symbol support structure */ #define FS_INIT 8 #define FS_EXIT 16 #define FS_MESSAGE 32 - -#define VS_PRIVATE 64 -#define VS_PUBLIC 128 -#define VS_MEMVAR (VS_PRIVATE | VS_PUBLIC) +#define FS_MEMVAR 128 void VirtualMachine( PBYTE pCode, PSYMBOL pSymbols ); /* invokes the virtual machine */ void ProcessSymbols( SYMBOL *, WORD ); diff --git a/harbour/include/hberrors.h b/harbour/include/hberrors.h index d800af33fe..364f6853eb 100644 --- a/harbour/include/hberrors.h +++ b/harbour/include/hberrors.h @@ -30,7 +30,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit their web site at http://www.gnu.org/). -*/ +*/ #ifndef HB_ERROR_H_ #define HB_ERROR_H_ @@ -62,16 +62,17 @@ #define ERR_CHECKING_ARGS 21 #define WARN_AMBIGUOUS_VAR 1 -#define WARN_VAR_NOT_USED 2 -#define WARN_BLOCKVAR_NOT_USED 3 -#define WARN_ASSIGN_TYPE 4 -#define WARN_LOGICAL_TYPE 5 -#define WARN_NUMERIC_TYPE 6 -#define WARN_OPERANDS_INCOMPATBLE 7 -#define WARN_ASSIGN_SUSPECT 8 -#define WARN_OPERAND_SUSPECT 9 -#define WARN_LOGICAL_SUSPECT 10 -#define WARN_NUMERIC_SUSPECT 11 +#define WARN_MEMVAR_ASSUMED 2 +#define WARN_VAR_NOT_USED 3 +#define WARN_BLOCKVAR_NOT_USED 4 +#define WARN_ASSIGN_TYPE 5 +#define WARN_LOGICAL_TYPE 6 +#define WARN_NUMERIC_TYPE 7 +#define WARN_OPERANDS_INCOMPATBLE 8 +#define WARN_ASSIGN_SUSPECT 9 +#define WARN_OPERAND_SUSPECT 10 +#define WARN_LOGICAL_SUSPECT 11 +#define WARN_NUMERIC_SUSPECT 12 /* * Errors generated by Harbour preprocessor diff --git a/harbour/source/compiler/harbour.y b/harbour/source/compiler/harbour.y index 3d36095f35..3ae6638549 100644 --- a/harbour/source/compiler/harbour.y +++ b/harbour/source/compiler/harbour.y @@ -197,6 +197,7 @@ void * GenElseIf( void * pFirstElseIf, WORD wOffset ); /* generates a support st void GenExterns( void ); /* generates the symbols for the EXTERN names */ void GenReturn( WORD wOffset ); /* generates a return offset to later on fill it with the proper exiting pcode address */ PFUNCTION GetFuncall( char * szFunName ); /* locates a previously defined called function */ +WORD GetAliasedVarPos( PVAR pVars, char * szAlias, char * szVarName ); /* check for aliased variable */ PVAR GetVar( PVAR pVars, WORD wOrder ); /* returns a variable if defined or zero */ WORD GetVarPos( PVAR pVars, char * szVarName ); /* returns the order + 1 of a variable if defined or zero */ int GetLocalVarPos( char * szVarName ); /* returns the order + 1 of a local variable */ @@ -276,6 +277,9 @@ typedef enum #define VS_STATIC 2 #define VS_FIELD 4 #define VS_PARAMETER 8 +#define VS_PRIVATE 64 +#define VS_PUBLIC 128 +#define VS_MEMVAR (VS_PUBLIC | VS_PRIVATE) int iVarScope = VS_LOCAL; /* holds the scope for next variables to be defined */ /* different values for iVarScope */ @@ -305,6 +309,7 @@ char * _szCErrors[] = { "Statement not allowed outside of procedure or function" /* Table with parse warnings */ char * _szWarnings[] = { + "Ambiguous reference: \'%s\'", "Ambiguous reference, assuming memvar: \'%s\'", "Variable: \'%s\' declared but not used in function: \'%s\'", "CodeBlock Parameter: \'%s\' declared but not used in function: \'%s\'", @@ -425,6 +430,8 @@ int _iLanguage = LANG_C; /* default Harbour generated output language */ int _iRestrictSymbolLength = 0; /* generate 10 chars max symbols length */ int _iShortCuts = 1; /* .and. & .or. expressions shortcuts */ int _iWarnings = 0; /* enable parse warnings */ +int _iAutoMemvarAssume = 0; /* holds if undeclared variables are automatically assumed MEMVAR */ +int _iForceMemvars = 0; /* holds if memvars are assumed when accesing undeclared variable */ WORD _wSeqCounter = 0; WORD _wForCounter = 0; @@ -1187,6 +1194,7 @@ int harbour_main( int argc, char * argv[] ) case 'a': case 'A': + _iAutoMemvarAssume =1; break; case 'd': @@ -1290,6 +1298,7 @@ int harbour_main( int argc, char * argv[] ) case 'v': case 'V': + _iForceMemvars =1; break; case 'w': @@ -1376,8 +1385,8 @@ int harbour_main( int argc, char * argv[] ) if( _iStartProc ) FunDef( yy_strupr( yy_strdup( _pFileName->name ) ), FS_PUBLIC, FUN_PROCEDURE ); else - /* Don't pass the name of module if the code for starting procedure - * will be not generated. The name cannot be placed as first symbol + /* Don't pass the name of module if the code for starting procedure + * will be not generated. The name cannot be placed as first symbol * because this symbol can be used as function call or memvar's name. */ FunDef( yy_strupr( yy_strdup( "" ) ), FS_PUBLIC, FUN_PROCEDURE ); @@ -1731,6 +1740,7 @@ void AddVar( char * szVarName ) /* variable defined in a function/procedure */ CheckDuplVars( pFunc->pFields, szVarName, iVarScope ); CheckDuplVars( pFunc->pStatics, szVarName, iVarScope ); + CheckDuplVars( pFunc->pMemvars, szVarName, iVarScope ); } else /* variable defined in a codeblock */ @@ -1749,22 +1759,25 @@ void AddVar( char * szVarName ) PCOMSYMBOL pSym; WORD wPos; - if( ! pFunc->pMemvars ) - pFunc->pMemvars = pVar; - else + if( _iAutoMemvarAssume || iVarScope == VS_MEMVAR ) { - pLastVar = pFunc->pMemvars; - while( pLastVar->pNext ) - pLastVar = pLastVar->pNext; - pLastVar->pNext = pVar; + /** add this variable to the list of MEMVAR variables + */ + if( ! pFunc->pMemvars ) + pFunc->pMemvars = pVar; + else + { + pLastVar = pFunc->pMemvars; + while( pLastVar->pNext ) + pLastVar = pLastVar->pNext; + pLastVar->pNext = pVar; + } } switch( iVarScope ) { case VS_MEMVAR: /* variable declared in MEMVAR statement */ - pSym =AddSymbol( yy_strdup(szVarName), &wPos ); - pSym->cScope |= VS_MEMVAR; break; case (VS_PARAMETER | VS_PRIVATE): { @@ -1772,7 +1785,7 @@ void AddVar( char * szVarName ) pSym =GetSymbol( szVarName, &wPos ); /* check if symbol exists already */ if( ! pSym ) pSym =AddSymbol( yy_strdup(szVarName), &wPos ); - pSym->cScope |= VS_MEMVAR; + pSym->cScope |=VS_MEMVAR; GenPCode3( HB_P_PARAMETER, LOBYTE(wPos), HIBYTE(wPos) ); GenPCode1( LOBYTE(functions.pLast->wParamCount) ); } @@ -1783,8 +1796,8 @@ void AddVar( char * szVarName ) PushNil(); PushSymbol( yy_strdup(szVarName), 0 ); Do( 1 ); - pSym =GetSymbol( szVarName, &wPos ); - pSym->cScope |= VS_MEMVAR; + pSym =GetSymbol( szVarName, NULL ); + pSym->cScope |=VS_MEMVAR; } break; case VS_PUBLIC: @@ -1793,8 +1806,8 @@ void AddVar( char * szVarName ) PushNil(); PushSymbol( yy_strdup(szVarName), 0 ); Do( 1 ); - pSym =GetSymbol( szVarName, &wPos ); - pSym->cScope |= VS_MEMVAR; + pSym =GetSymbol( szVarName, NULL ); + pSym->cScope |=VS_MEMVAR; } break; } @@ -1980,7 +1993,7 @@ void Duplicate( void ) pNewStackType->pPrev = pStackValType; pStackValType = pNewStackType; - /*debug_msg( "\n***Duplicate()\n ", NULL );*/ + /*debug_msg( "\n* *Duplicate()\n ", NULL );*/ } } @@ -2175,12 +2188,12 @@ void GenCCode( char *szFileName, char *szName ) /* generates the C languag else fprintf( yyc, "FS_PUBLIC" ); + if( pSym->cScope & VS_MEMVAR ) + fprintf( yyc, " | FS_MEMVAR" ); + if( ( pSym->cScope != FS_MESSAGE ) && ( pSym->cScope & FS_MESSAGE ) ) /* only for non public symbols */ fprintf( yyc, " | FS_MESSAGE" ); - if( pSym->cScope & VS_MEMVAR ) - fprintf( yyc, " | VS_MEMVAR" ); - /* specify the function address if it is a defined function or an external called function */ if( GetFunction( pSym->szName ) ) /* is it a function defined in this module */ @@ -3002,7 +3015,7 @@ WORD GetVarPos( PVAR pVars, char * szVarName ) /* returns the order + 1 of a var pNewStackType->pPrev = pStackValType; pStackValType = pNewStackType; - debug_msg( "\n***GetVarPos()\n", NULL ); + debug_msg( "\n* *GetVarPos()\n", NULL ); } return wVar; } @@ -3136,6 +3149,106 @@ int GetStaticVarPos( char *szVarName ) return 0; } +/* Checks if passed aliased variable is declared in passed variable's list + * returns the order + 1 of a variable if defined or zero + */ +WORD GetAliasedVarPos( PVAR pVars, char *szAlias, char *szVarName ) +{ + WORD wVar = 1; + + /*TODO: add checking for alias */ + szAlias =szAlias; + while( pVars ) + { + if( pVars->szName && ! strcmp( pVars->szName, szVarName ) ) + { + if( _iWarnings ) + { + PSTACK_VAL_TYPE pNewStackType; + + pVars->iUsed = 1; + + pNewStackType = ( STACK_VAL_TYPE * )OurMalloc( sizeof( STACK_VAL_TYPE ) ); + pNewStackType->cType = pVars->cType; + pNewStackType->pPrev = pStackValType; + + pStackValType = pNewStackType; + debug_msg( "\n* *GetAliasedVarPos()\n", NULL ); + } + return wVar; + } + else + { + if( pVars->pNext ) + { + pVars = pVars->pNext; + wVar++; + } + else + return 0; + } + } + return 0; +} + +/* Checks if passed variable name is declared as FIELD + * Returns 0 if not found in FIELD list or its position in this list if found + */ +int GetFieldVarPos( char *szVarName ) +{ + int iVar; + PFUNCTION pFunc =functions.pLast; + + if( pFunc->szName ) + /* we are in a function/procedure -we don't need any tricks */ + iVar =GetAliasedVarPos( pFunc->pFields, NULL, szVarName ); + else + { + /* we have to check the list of nested codeblock up to a function + * where the codeblock is defined + */ + while( pFunc->pOwner ) + pFunc =pFunc->pOwner; + iVar =GetAliasedVarPos( pFunc->pFields, NULL, szVarName ); + } + /* If not found on the list declared in current function then check + * the global list (only if there will be no starting procedure) + */ + if( ! iVar && ! _iStartProc ) + iVar =GetAliasedVarPos( functions.pFirst->pFields, NULL, szVarName ); + + return iVar; +} + +/** Checks if passed variable name is declared as FIELD + * Returns 0 if not found in FIELD list or its position in this list if found + */ +int GetMemvarPos( char *szVarName ) +{ + int iVar; + PFUNCTION pFunc =functions.pLast; + + if( pFunc->szName ) + /* we are in a function/procedure -we don't need any tricks */ + iVar =GetAliasedVarPos( pFunc->pMemvars, NULL, szVarName ); + else + { + /* we have to check the list of nested codeblock up to a function + * where the codeblock is defined + */ + while( pFunc->pOwner ) + pFunc =pFunc->pOwner; + iVar =GetAliasedVarPos( pFunc->pMemvars, NULL, szVarName ); + } + /* if not found on the list declared in current function then check + * the global list (only if there will be no starting procedure) + */ + if( ! iVar && ! _iStartProc ) + iVar =GetAliasedVarPos( functions.pFirst->pMemvars, NULL, szVarName ); + + return iVar; +} + WORD FixSymbolPos( WORD wCompilePos ) { return (_iStartProc ? wCompilePos-1 : wCompilePos-2); @@ -3222,7 +3335,7 @@ void Inc( void ) sType[1] = 0; } else - debug_msg( "\n***Inc() Compile time stack overflow\n", NULL ); + debug_msg( "\n* *Inc() Compile time stack overflow\n", NULL ); if( pStackValType && pStackValType->cType == ' ' ) @@ -3254,7 +3367,7 @@ WORD JumpFalse( int iOffset ) sType[1] = 0; } else - debug_msg( "\n***HB_P_JUMPFALSE Compile time stack overflow\n", NULL ); + debug_msg( "\n* *HB_P_JUMPFALSE Compile time stack overflow\n", NULL ); /* compile time Operand value */ if( pStackValType && pStackValType->cType == ' ' ) @@ -3264,7 +3377,7 @@ WORD JumpFalse( int iOffset ) /* compile time assignment value has to be released */ pFree = pStackValType; - debug_msg( "\n***---JampFalse()\n", NULL ); + debug_msg( "\n* *---JampFalse()\n", NULL ); if( pStackValType ) { @@ -3308,7 +3421,7 @@ WORD JumpTrue( int iOffset ) sType[1] = 0; } else - debug_msg( "\n***HB_P_JUMPTRUE Compile time stack overflow\n", NULL ); + debug_msg( "\n* *HB_P_JUMPTRUE Compile time stack overflow\n", NULL ); /* compile time Operand value */ if( pStackValType && pStackValType->cType == ' ' ) @@ -3318,7 +3431,7 @@ WORD JumpTrue( int iOffset ) /* compile time assignment value has to be released */ pFree = pStackValType; - debug_msg( "\n***---JampTrue() \n", NULL ); + debug_msg( "\n* *---JampTrue() \n", NULL ); if( pStackValType ) { @@ -3357,7 +3470,7 @@ void LineBody( void ) /* generates the pcode with the currently compiled source GenPCode3( HB_P_LINE, LOBYTE( iLine ), HIBYTE( iLine ) ); } -/* +/** * Function generates passed pcode for passed variable name */ void MemvarPCode( BYTE bPCode, char * szVarName ) @@ -3365,7 +3478,29 @@ void MemvarPCode( BYTE bPCode, char * szVarName ) WORD wVar; PCOMSYMBOL pVar; - GenWarning( WARN_AMBIGUOUS_VAR, szVarName, NULL ); + if( _iForceMemvars ) + { + wVar =GetMemvarPos( szVarName ); + if( ! wVar ) + { + wVar =GetFieldVarPos( szVarName ); + if( ! wVar ) + GenWarning( ((bPCode==HB_P_POPMEMVAR) ? WARN_MEMVAR_ASSUMED : WARN_AMBIGUOUS_VAR), + szVarName, NULL ); + } + } + else + { + wVar =GetFieldVarPos( szVarName ); + if( ! wVar ) + { + wVar =GetMemvarPos( szVarName ); + if( ! wVar ) + GenWarning( ((bPCode==HB_P_POPMEMVAR) ? WARN_MEMVAR_ASSUMED : WARN_AMBIGUOUS_VAR), + szVarName, NULL ); + } + } + pVar = GetSymbol( szVarName, &wVar ); if( ! pVar ) @@ -4406,6 +4541,7 @@ void CodeBlockEnd() /*NOTE: 8 = HB_P_PUSHBLOCK + WORD(size) + WORD(wParams) + WORD(wLocals) +_ENDBLOCK */ wSize =( WORD ) pCodeblock->lPCodePos +8 +wLocals*2; + GenPCode3( HB_P_PUSHBLOCK, LOBYTE(wSize), HIBYTE(wSize) ); GenPCode1( LOBYTE(pCodeblock->wParamCount) ); GenPCode1( HIBYTE(pCodeblock->wParamCount) ); @@ -4453,7 +4589,6 @@ void CodeBlockEnd() else debug_msg( "\n***CodeBlockEnd() Compile time stack overflow\n", NULL ); } - } /* Set the name of an alias for the list of previously declared FIELDs diff --git a/harbour/source/hbpp/table.c b/harbour/source/hbpp/table.c index cb57399054..80bacf96a1 100644 --- a/harbour/source/hbpp/table.c +++ b/harbour/source/hbpp/table.c @@ -208,17 +208,17 @@ COMMANDS aCommands[] = {0,"SET","KEY \1A00 TO \1B20&>","if ( Empty(\1B30) ) ; SetKey( \1A00, NIL ) ; else ; SetKey( \1A00, {|p, l, v| \1B00(p, l, v)} ) ; end"}, {0,"SET","KEY \1A00 [TO]","SetKey( \1A00, NIL )"}, {0,"SET","FUNCTION \1A00 [TO] [\1B00]","__SetFunction( \1A00, \1B00 )"}, - {0,"CLEAR","MEMORY","__MClear()"}, - {0,"RELEASE","\1A10s","__MXRelease( \1A20 )"}, - {0,"RELEASE","ALL","__MRelease('*', .t.)"}, - {0,"RELEASE","ALL LIKE \1A00","__MRelease( \1A10, .t. )"}, - {0,"RELEASE","ALL EXCEPT \1A00","__MRelease( \1A10, .f. )"}, - {0,"RESTORE","[FROM \1A40] [\1B20 ADDITIVE>]","__MRestore( \1A30, \1B50 )"}, - {0,"SAVE","ALL LIKE \1A00 TO \1B40","__MSave( \1B30, \1A30, .t. )"}, - {0,"SAVE","TO \1A40 ALL LIKE \1B00","__MSave( \1A30, \1B30, .t. )"}, - {0,"SAVE","ALL EXCEPT \1A00 TO \1B40","__MSave( \1B30, \1A30, .f. )"}, - {0,"SAVE","TO \1A40 ALL EXCEPT \1B00","__MSave( \1A30, \1B30, .f. )"}, - {0,"SAVE","[TO \1A40] [ALL]","__MSave( \1A30, '*', .t. )"}, + {0,"CLEAR","MEMORY","__MVClear()"}, + {0,"RELEASE","\1A10s","__MVXRelease( \1A20 )"}, + {0,"RELEASE","ALL","__MVRelease('*', .t.)"}, + {0,"RELEASE","ALL LIKE \1A00","__MVRelease( \1A10, .t. )"}, + {0,"RELEASE","ALL EXCEPT \1A00","__MVRelease( \1A10, .f. )"}, + {0,"RESTORE","[FROM \1A40] [\1B20 ADDITIVE>]","__MVRestore( \1A30, \1B50 )"}, + {0,"SAVE","ALL LIKE \1A00 TO \1B40","__MVSave( \1B30, \1A30, .t. )"}, + {0,"SAVE","TO \1A40 ALL LIKE \1B00","__MVSave( \1A30, \1B30, .t. )"}, + {0,"SAVE","ALL EXCEPT \1A00 TO \1B40","__MVSave( \1B30, \1A30, .f. )"}, + {0,"SAVE","TO \1A40 ALL EXCEPT \1B00","__MVSave( \1A30, \1B30, .f. )"}, + {0,"SAVE","[TO \1A40] [ALL]","__MVSave( \1A30, '*', .t. )"}, {0,"ERASE","\1A40","FErase( \1A30 )"}, {0,"DELETE","FILE \1A40","FErase( \1A30 )"}, {0,"RENAME","\1A40 TO \1B40","FRename( \1A30, \1B30 )"}, diff --git a/harbour/source/rdd/Makefile b/harbour/source/rdd/Makefile index 1573c81978..f0c4517bc9 100644 --- a/harbour/source/rdd/Makefile +++ b/harbour/source/rdd/Makefile @@ -4,4 +4,12 @@ ROOT = ../../ -include $(TOP)$(ROOT)config/dir.cf +C_SOURCES=\ + dbcmd.c \ + +PRG_SOURCES=\ + rddsys.prg \ + +LIB=rdd + +include $(TOP)$(ROOT)config/lib.cf diff --git a/harbour/source/rtl/arrays.c b/harbour/source/rtl/arrays.c index 7a0891d5b6..eae43904b3 100644 --- a/harbour/source/rtl/arrays.c +++ b/harbour/source/rtl/arrays.c @@ -65,9 +65,6 @@ PHB_ITEM hb_itemArrayPut( PHB_ITEM , ULONG , PHB_ITEM ); extern STACK stack; extern SYMBOL symEval; -static char *szBoundError = "Bound error: Array access"; -static char *szArgumentError = "Argument error: incorrect type"; - /* * Internal @@ -108,12 +105,12 @@ char * hb_arrayGetDate( PHB_ITEM pArray, ULONG ulIndex ) } else { - hb_errorRT_BASE(EG_ARG, 1132, "Bound error", "array access"); + hb_errorRT_BASE(EG_BOUND, 1132, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } } else { - hb_errorRT_BASE(EG_ARG, 1068, "Argument error", "array access"); + hb_errorRT_BASE(EG_ARG, 1068, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } return " "; } @@ -134,12 +131,12 @@ BOOL hb_arrayGetBool( PHB_ITEM pArray, ULONG ulIndex ) } else { - hb_errorRT_BASE(EG_ARG, 1132, "Bound error", "array access"); + hb_errorRT_BASE(EG_BOUND, 1132, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } } else { - hb_errorRT_BASE(EG_ARG, 1068, "Argument error", "array access"); + hb_errorRT_BASE(EG_ARG, 1068, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } return 0; } @@ -166,12 +163,12 @@ double hb_arrayGetDouble( PHB_ITEM pArray, ULONG ulIndex ) } else { - hb_errorRT_BASE(EG_ARG, 1132, "Bound error", "array access"); + hb_errorRT_BASE(EG_BOUND, 1132, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } } else { - hb_errorRT_BASE(EG_ARG, 1068, "Argument error", "array access"); + hb_errorRT_BASE(EG_ARG, 1068, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } return 0; } @@ -218,12 +215,12 @@ void hb_arrayGet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem ) ItemCopy( pItem, pArray->item.asArray.value->pItems + ( ulIndex - 1 ) ); else { - hb_errorRT_BASE(EG_ARG, 1132, "Bound error", "array access"); + hb_errorRT_BASE(EG_BOUND, 1132, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } } else { - hb_errorRT_BASE(EG_ARG, 1068, "Argument error", "array access"); + hb_errorRT_BASE(EG_ARG, 1068, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } } @@ -242,12 +239,12 @@ char *hb_arrayGetString( PHB_ITEM pArray, ULONG ulIndex ) } else { - hb_errorRT_BASE(EG_ARG, 1132, "Bound error", "array access"); + hb_errorRT_BASE(EG_BOUND, 1132, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } } else { - hb_errorRT_BASE(EG_ARG, 1068, "Argument error", "array access"); + hb_errorRT_BASE(EG_ARG, 1068, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } return ""; } @@ -267,12 +264,12 @@ ULONG hb_arrayGetStringLen( PHB_ITEM pArray, ULONG ulIndex ) } else { - hb_errorRT_BASE(EG_ARG, 1132, "Bound error", "array access"); + hb_errorRT_BASE(EG_BOUND, 1132, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } } else { - hb_errorRT_BASE(EG_ARG, 1068, "Argument error", "array access"); + hb_errorRT_BASE(EG_ARG, 1068, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } return 0; } @@ -288,12 +285,12 @@ int hb_arrayGetType( PHB_ITEM pArray, ULONG ulIndex ) } else { - hb_errorRT_BASE(EG_ARG, 1132, "Bound error", "array access"); + hb_errorRT_BASE(EG_BOUND, 1132, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } } else { - hb_errorRT_BASE(EG_ARG, 1068, "Argument error", "array access"); + hb_errorRT_BASE(EG_ARG, 1068, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } return 0; } @@ -313,7 +310,7 @@ ULONG hb_arrayLen( PHB_ITEM pArray ) return pArray->item.asArray.value->ulLen; else { - hb_errorRT_BASE(EG_ARG, 1068, "Argument error", "array access"); + hb_errorRT_BASE(EG_ARG, 1068, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } return 0; } @@ -326,12 +323,12 @@ void hb_arraySet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem ) ItemCopy( pArray->item.asArray.value->pItems + ( ulIndex - 1 ), pItem ); else { - hb_errorRT_BASE(EG_ARG, 1133, "Bound error", "array assign"); + hb_errorRT_BASE(EG_BOUND, 1133, NULL, hb_ErrorNatDescription(EG_ARRASSIGN)); } } else { - hb_errorRT_BASE(EG_ARG, 1069, "Argument error", "array assign"); + hb_errorRT_BASE(EG_ARG, 1069, NULL, hb_ErrorNatDescription(EG_ARRASSIGN)); } } @@ -394,10 +391,7 @@ void hb_arrayFill( PHB_ITEM pArray, PHB_ITEM pValue, ULONG ulStart, ULONG ulCoun } else { - PHB_ITEM pError = hb_errNew(); - hb_errPutDescription( pError, szArgumentError ); - hb_errLaunch( pError ); - hb_errRelease( pError ); + hb_errorRT_BASE(EG_ARG, 1068, NULL, hb_ErrorNatDescription(EG_NOTARRAY)); } } @@ -420,18 +414,12 @@ void hb_arrayDel( PHB_ITEM pArray, ULONG ulIndex ) } else { - PHB_ITEM pError = hb_errNew(); - hb_errPutDescription( pError, szBoundError ); - hb_errLaunch( pError ); - hb_errRelease( pError ); + hb_errorRT_BASE(EG_BOUND, 1132, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } } else { - PHB_ITEM pError = hb_errNew(); - hb_errPutDescription( pError, szArgumentError ); - hb_errLaunch( pError ); - hb_errRelease( pError ); + hb_errorRT_BASE(EG_ARG, 1068, NULL, hb_ErrorNatDescription(EG_NOTARRAY)); } } @@ -454,18 +442,12 @@ void hb_arrayIns( PHB_ITEM pArray, ULONG ulIndex ) } else { - PHB_ITEM pError = hb_errNew(); - hb_errPutDescription( pError, szBoundError ); - hb_errLaunch( pError ); - hb_errRelease( pError ); + hb_errorRT_BASE(EG_BOUND, 1132, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); } } else { - PHB_ITEM pError = hb_errNew(); - hb_errPutDescription( pError, szArgumentError ); - hb_errLaunch( pError ); - hb_errRelease( pError ); + hb_errorRT_BASE(EG_ARG, 1068, NULL, hb_ErrorNatDescription(EG_NOTARRAY)); } } @@ -539,10 +521,7 @@ int hb_arrayScan( PHB_ITEM pArray, PHB_ITEM pValue, ULONG ulStart, ULONG ulCount } else { - PHB_ITEM pError = hb_errNew(); - hb_errPutDescription( pError, szArgumentError ); - hb_errLaunch( pError ); - hb_errRelease( pError ); + hb_errorRT_BASE(EG_ARG, 1068, NULL, hb_ErrorNatDescription(EG_NOTARRAY)); } return 0; } @@ -577,7 +556,7 @@ void hb_arrayEval( PHB_ITEM pArray, PHB_ITEM bBlock, ULONG ulStart, ULONG ulCoun } else { - hb_errorRT_BASE(EG_ARG, 2017, "Argument error", "AEVAL"); + hb_errorRT_BASE(EG_ARG, 2017, NULL, "AEVAL"); } } @@ -603,10 +582,7 @@ void hb_arrayRelease( PHB_ITEM pArray ) } else { - PHB_ITEM pError = hb_errNew(); - hb_errPutDescription( pError, szArgumentError ); - hb_errLaunch( pError ); - hb_errRelease( pError ); + hb_errorRT_BASE(EG_ARG, 1068, NULL, hb_ErrorNatDescription(EG_NOTARRAY)); } } @@ -644,10 +620,7 @@ void hb_arrayCopy( PHB_ITEM pSrcArray, PHB_ITEM pDstArray, ULONG ulStart, } else { - PHB_ITEM pError = hb_errNew(); - hb_errPutDescription( pError, szArgumentError ); - hb_errLaunch( pError ); - hb_errRelease( pError ); + hb_errorRT_BASE(EG_ARG, 1068, NULL, hb_ErrorNatDescription(EG_NOTARRAY)); } } @@ -684,10 +657,7 @@ PHB_ITEM hb_arrayClone( PHB_ITEM pSrcArray ) } else { - PHB_ITEM pError = hb_errNew(); - hb_errPutDescription( pError, szArgumentError ); - hb_errLaunch( pError ); - hb_errRelease( pError ); + hb_errorRT_BASE(EG_ARG, 1068, NULL, hb_ErrorNatDescription(EG_NOTARRAY)); } return pDstArray; } diff --git a/harbour/source/rtl/classes.c b/harbour/source/rtl/classes.c index cd05e08587..fdfb411eb1 100644 --- a/harbour/source/rtl/classes.c +++ b/harbour/source/rtl/classes.c @@ -486,10 +486,8 @@ HARBOUR HB_CLASSMOD(void) hb_param( 3, IT_BLOCK ) ); else if( ( pFunc == SetData ) || ( pFunc == GetData ) ) { /* Not allowed for DATA */ - PHB_ITEM pError = hb_errNew(); - hb_errPutDescription(pError, "CLASSMOD: Cannot modify a DATA item"); - hb_errLaunch(pError); - hb_errRelease(pError); + /*hb_errPutDescription(pError, "CLASSMOD: Cannot modify a DATA item");*/ + hb_errorRT_BASE(EG_ARG, 3001, NULL, "CLASSMOD"); } else /* Modify METHOD */ pClass->pMethods[ wAt ].pFunction = ( HARBOURFUNC ) hb_parnl( 3 ); @@ -815,10 +813,7 @@ HARBOUR HB_ISMESSAGE(void) hb_retl( hb_isMessage( pObject, pString->item.asString.value ) != 0 ); else { - PHB_ITEM pError = hb_errNew(); - hb_errPutDescription(pError, "Argument error: ISMESSAGE"); - hb_errLaunch(pError); - hb_errRelease(pError); + hb_errorRT_BASE(EG_ARG, 3000, NULL, "ISMESSAGE"); } } @@ -841,10 +836,7 @@ HARBOUR HB_OCLONE( void ) } else { - PHB_ITEM pError = hb_errNew(); - hb_errPutDescription(pError, "Argument error: OCLONE"); - hb_errLaunch(pError); - hb_errRelease(pError); + hb_errorRT_BASE(EG_ARG, 3000, NULL, "OCLONE"); } } @@ -871,10 +863,7 @@ HARBOUR HB_OSEND(void) } else { - PHB_ITEM pError = hb_errNew(); - hb_errPutDescription(pError, "Argument error: OSEND"); - hb_errLaunch(pError); - hb_errRelease(pError); + hb_errorRT_BASE(EG_ARG, 3000, NULL, "OSEND"); } } @@ -1016,10 +1005,8 @@ HARBOUR HB___INSTSUPER( void ) if( !IS_OBJECT( &stack.Return ) ) { - PHB_ITEM pError = hb_errNew(); - hb_errPutDescription(pError, "INSTSUPER : Super class does not return an object"); - hb_errLaunch(pError); - hb_errRelease(pError); + /* hb_errPutDescription(pError, "INSTSUPER : Super class does not return an object"); */ + hb_errorRT_BASE(EG_ARG, 3002, NULL, "__INSTSUPER"); } for( w = 0; !bFound && w < wClasses; w++ ) @@ -1033,10 +1020,8 @@ HARBOUR HB___INSTSUPER( void ) } else { - PHB_ITEM pError = hb_errNew(); - hb_errPutDescription(pError, "INSTSUPER : Cannot find super class"); - hb_errLaunch(pError); - hb_errRelease(pError); + /* hb_errPutDescription(pError, "INSTSUPER : Cannot find super class"); */ + hb_errorRT_BASE(EG_ARG, 3003, NULL, "__INSTSUPER"); } } if( !bFound ) diff --git a/harbour/source/rtl/copyfile.c b/harbour/source/rtl/copyfile.c index d9b364d112..412185e5fd 100644 --- a/harbour/source/rtl/copyfile.c +++ b/harbour/source/rtl/copyfile.c @@ -69,7 +69,7 @@ HARBOUR HB___COPYFILE( void ) } else { - hb_errorRT_BASE(EG_ARG, 2010, "Argument error", "__COPYFILE"); + hb_errorRT_BASE(EG_ARG, 2010, NULL, "__COPYFILE"); } } @@ -84,7 +84,7 @@ static BOOL hb_fsCopy(char* szSource, char* szDest, ULONG* ulWrittenTotal) while ((fhndSource = hb_fsOpen((BYTEP)szSource, FO_READ)) == FS_ERROR) { - if (hb_errorRT_BASE(EG_ARG, 2012, "Open error", szSource) == E_DEFAULT) + if (hb_errorRT_BASE(EG_OPEN, 2012, NULL, szSource) == E_DEFAULT) { *ulWrittenTotal = (ULONG)-1L; break; @@ -95,7 +95,7 @@ static BOOL hb_fsCopy(char* szSource, char* szDest, ULONG* ulWrittenTotal) { while ((fhndDest = hb_fsCreate((BYTEP)szDest, FC_NORMAL)) == FS_ERROR) { - if (hb_errorRT_BASE(EG_ARG, 2012, "Create error", szDest) == E_DEFAULT) + if (hb_errorRT_BASE(EG_CREATE, 2012, NULL, szDest) == E_DEFAULT) { *ulWrittenTotal = (ULONG)-2L; break; @@ -123,7 +123,7 @@ static BOOL hb_fsCopy(char* szSource, char* szDest, ULONG* ulWrittenTotal) { while ((usWritten = hb_fsWrite(fhndDest, buffer, usRead)) != usRead) { - if (hb_errorRT_BASE(EG_ARG, 2012, "Write error", szDest) == E_DEFAULT) + if (hb_errorRT_BASE(EG_WRITE, 2012, NULL, szDest) == E_DEFAULT) { bRetVal = FALSE; break; diff --git a/harbour/source/rtl/dates.c b/harbour/source/rtl/dates.c index 5b6dc291f3..e7f3d1166b 100644 --- a/harbour/source/rtl/dates.c +++ b/harbour/source/rtl/dates.c @@ -29,7 +29,7 @@ * See doc/hdr_tpl.txt, Version 1.2 or later, for licensing terms. * * The following functions are Copyright 1999 Jose Lalin : - * hb__seconds(), HB_SECONDS(), hb_cmonth(), HB_CMONTH(), + * hb__seconds(), HB_SECONDS(), hb_cmonth(), HB_CMONTH(), * hb_cdow(), HB_CDOW(), HB_DAY(), HB_MONTH(), HB_YEAR(), * hb_dow(), HB_DOW() */ @@ -419,13 +419,13 @@ HARBOUR HB_DTOS( void ) } else { - hb_errorRT_BASE(EG_ARG, 1120, "Argument error", "DTOS"); + hb_errorRT_BASE(EG_ARG, 1120, NULL, "DTOS"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1120, "Incorrect number of arguments", "DTOS"); + hb_errorRT_BASE(EG_ARGCOUNT, 1120, NULL, "DTOS"); } #endif } @@ -459,7 +459,7 @@ HARBOUR HB_DAY( void ) } else { - hb_errorRT_BASE(EG_ARG, 1114, "Argument error", "DAY"); + hb_errorRT_BASE(EG_ARG, 1114, NULL, "DAY"); } } @@ -487,7 +487,7 @@ HARBOUR HB_MONTH( void ) } else { - hb_errorRT_BASE(EG_ARG, 1113, "Argument error", "MONTH"); + hb_errorRT_BASE(EG_ARG, 1113, NULL, "MONTH"); } } @@ -515,7 +515,7 @@ HARBOUR HB_YEAR( void ) } else { - hb_errorRT_BASE(EG_ARG, 1112, "Argument error", "YEAR"); + hb_errorRT_BASE(EG_ARG, 1112, NULL, "YEAR"); } } @@ -534,7 +534,7 @@ HARBOUR HB_TIME( void ) } else { - hb_errorRT_BASE(EG_ARG, 9999, "Incorrect number of arguments", "TIME"); + hb_errorRT_BASE(EG_ARGCOUNT, 9999, NULL, "TIME"); } } @@ -554,7 +554,7 @@ HARBOUR HB_DATE( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 9999, "Incorrect number of arguments", "DATE"); + hb_errorRT_BASE(EG_ARGCOUNT, 9999, NULL, "DATE"); } } long hb_dow( long d, long m, long y ) @@ -603,7 +603,7 @@ HARBOUR HB_DOW( void ) } else { - hb_errorRT_BASE(EG_ARG, 1115, "Argument error", "DOW"); + hb_errorRT_BASE(EG_ARG, 1115, NULL, "DOW"); } } @@ -621,13 +621,13 @@ HARBOUR HB_CMONTH( void ) } else { - hb_errorRT_BASE(EG_ARG, 1116, "Argument error", "CMONTH"); + hb_errorRT_BASE(EG_ARG, 1116, NULL, "CMONTH"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1116, "Incorrect number of arguments", "CMONTH"); + hb_errorRT_BASE(EG_ARGCOUNT, 1116, NULL, "CMONTH"); } } @@ -645,13 +645,13 @@ HARBOUR HB_CDOW( void ) } else { - hb_errorRT_BASE(EG_ARG, 1117, "Argument error", "CDOW"); + hb_errorRT_BASE(EG_ARG, 1117, NULL, "CDOW"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1117, "Incorrect number of arguments", "CDOW"); + hb_errorRT_BASE(EG_ARGCOUNT, 1117, NULL, "CDOW"); } } @@ -662,6 +662,6 @@ HARBOUR HB_SECONDS( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 9999, "Incorrect number of arguments", "SECONDS"); + hb_errorRT_BASE(EG_ARGCOUNT, 9999, NULL, "SECONDS"); } } diff --git a/harbour/source/rtl/errorapi.c b/harbour/source/rtl/errorapi.c index b4981c895f..bf5c58718a 100644 --- a/harbour/source/rtl/errorapi.c +++ b/harbour/source/rtl/errorapi.c @@ -283,7 +283,10 @@ WORD hb_errorRT_BASE( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, ch hb_errPutSubSystem( pError, HB_ERR_SS_BASE ); hb_errPutGenCode( pError, ulGenCode ); hb_errPutSubCode( pError, ulSubCode ); - hb_errPutDescription( pError, szDescription ); + if( szDescription ) + hb_errPutDescription( pError, szDescription ); + else + hb_errPutDescription( pError, hb_ErrorNatDescription(ulGenCode) ); hb_errPutOperation( pError, szOperation ); wRetVal = hb_errLaunch( pError ); @@ -302,7 +305,10 @@ WORD hb_errorRT_TERMINAL( ULONG ulGenCode, ULONG ulSubCode, char * szDescription hb_errPutSubSystem( pError, HB_ERR_SS_TERMINAL ); hb_errPutGenCode( pError, ulGenCode ); hb_errPutSubCode( pError, ulSubCode ); - hb_errPutDescription( pError, szDescription ); + if( szDescription ) + hb_errPutDescription( pError, szDescription ); + else + hb_errPutDescription( pError, hb_ErrorNatDescription(ulGenCode) ); hb_errPutOperation( pError, szOperation ); wRetVal = hb_errLaunch( pError ); @@ -321,7 +327,10 @@ WORD hb_errorRT_DBCMD( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, c hb_errPutSubSystem( pError, HB_ERR_SS_DBCMD ); hb_errPutGenCode( pError, ulGenCode ); hb_errPutSubCode( pError, ulSubCode ); - hb_errPutDescription( pError, szDescription ); + if( szDescription ) + hb_errPutDescription( pError, szDescription ); + else + hb_errPutDescription( pError, hb_ErrorNatDescription(ulGenCode) ); hb_errPutOperation( pError, szOperation ); wRetVal = hb_errLaunch( pError ); diff --git a/harbour/source/rtl/gtxxx.c b/harbour/source/rtl/gtxxx.c index 7d8fa21e88..849db3083d 100644 --- a/harbour/source/rtl/gtxxx.c +++ b/harbour/source/rtl/gtxxx.c @@ -2,6 +2,8 @@ * $Id$ */ +#include "hbsetup.h" + #if defined(HARBOUR_USE_GTAPI) #if defined(HARBOUR_USE_DOS_GTAPI) #include "gt/gtdos.c" diff --git a/harbour/source/rtl/math.c b/harbour/source/rtl/math.c index 6d15320d3f..6e75ee8ed5 100644 --- a/harbour/source/rtl/math.c +++ b/harbour/source/rtl/math.c @@ -67,13 +67,13 @@ HARBOUR HB_ABS( void ) } else { - hb_errorRT_BASE(EG_ARG, 1089, "Argument error", "ABS"); + hb_errorRT_BASE(EG_ARG, 1089, NULL, "ABS"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1089, "Incorrect number of arguments", "ABS"); + hb_errorRT_BASE(EG_ARGCOUNT, 1089, NULL, "ABS"); } } @@ -91,13 +91,13 @@ HARBOUR HB_EXP( void ) } else { - hb_errorRT_BASE(EG_ARG, 1096, "Argument error", "EXP"); + hb_errorRT_BASE(EG_ARG, 1096, NULL, "EXP"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1096, "Incorrect number of arguments", "EXP"); + hb_errorRT_BASE(EG_ARGCOUNT, 1096, NULL, "EXP"); } } @@ -109,13 +109,13 @@ HARBOUR HB_INT( void ) hb_retnl( hb_parnd( 1 ) ); else { - hb_errorRT_BASE(EG_ARG, 1090, "Argument error", "INT"); + hb_errorRT_BASE(EG_ARG, 1090, NULL, "INT"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1090, "Incorrect number of arguments", "INT"); + hb_errorRT_BASE(EG_ARGCOUNT, 1090, NULL, "INT"); } } @@ -137,13 +137,13 @@ HARBOUR HB_LOG( void ) } else { - hb_errorRT_BASE(EG_ARG, 1095, "Argument error", "LOG"); + hb_errorRT_BASE(EG_ARG, 1095, NULL, "LOG"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1095, "Incorrect number of arguments", "LOG"); + hb_errorRT_BASE(EG_ARGCOUNT, 1095, NULL, "LOG"); } } @@ -170,13 +170,13 @@ HARBOUR HB_MAX( void ) } else { - hb_errorRT_BASE(EG_ARG, 1093, "Argument error", "MAX"); + hb_errorRT_BASE(EG_ARG, 1093, NULL, "MAX"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1093, "Incorrect number of arguments", "MAX"); + hb_errorRT_BASE(EG_ARGCOUNT, 1093, NULL, "MAX"); } } @@ -203,13 +203,13 @@ HARBOUR HB_MIN( void ) } else { - hb_errorRT_BASE(EG_ARG, 1092, "Argument error", "MIN"); + hb_errorRT_BASE(EG_ARG, 1092, NULL, "MIN"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1092, "Incorrect number of arguments", "MIN"); + hb_errorRT_BASE(EG_ARGCOUNT, 1092, NULL, "MIN"); } } @@ -252,7 +252,7 @@ FUNCTION MOD(cl_num, cl_base) } else { - hb_errorRT_BASE(EG_ARG, 1085, "Argument error", "%"); + hb_errorRT_BASE(EG_ARG, 1085, NULL, "%"); } } @@ -285,13 +285,13 @@ HARBOUR HB_ROUND( void ) } else { - hb_errorRT_BASE(EG_ARG, 1094, "Argument error", "ROUND"); + hb_errorRT_BASE(EG_ARG, 1094, NULL, "ROUND"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1094, "Incorrect number of arguments", "ROUND"); + hb_errorRT_BASE(EG_ARGCOUNT, 1094, NULL, "ROUND"); } } @@ -317,13 +317,13 @@ HARBOUR HB_SQRT( void ) } else { - hb_errorRT_BASE(EG_ARG, 1097, "Argument error", "SQRT"); + hb_errorRT_BASE(EG_ARG, 1097, NULL, "SQRT"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1097, "Incorrect number of arguments", "SQRT"); + hb_errorRT_BASE(EG_ARGCOUNT, 1097, NULL, "SQRT"); } } diff --git a/harbour/source/rtl/memvars.c b/harbour/source/rtl/memvars.c index c102f379ef..4a021defa9 100644 --- a/harbour/source/rtl/memvars.c +++ b/harbour/source/rtl/memvars.c @@ -38,6 +38,9 @@ #include #include +#define VS_PRIVATE 64 +#define VS_PUBLIC 128 + static PDYNSYM *_privateStack = NULL; static ULONG _privateStackSize = 0; static ULONG _privateStackCnt = 0; @@ -365,7 +368,7 @@ void hb_MemvarSetValue( PSYMBOL pMemvarSymb, HB_ITEM_PTR pItem ) } } else - hb_errorRT_BASE( EG_NOVAR, 1003, "Unknown variable: ", pMemvarSymb->szName ); + hb_errorRT_BASE( EG_NOVAR, 1003, NULL, pMemvarSymb->szName ); } void hb_MemvarGetValue( HB_ITEM_PTR pItem, PSYMBOL pMemvarSymb ) @@ -390,10 +393,10 @@ void hb_MemvarGetValue( HB_ITEM_PTR pItem, PSYMBOL pMemvarSymb ) ItemCopy( pItem, pGetItem ); } else /* variable is not initialized */ - hb_errorRT_BASE( EG_NOVAR, 1003, "Variable does not exist: ", pMemvarSymb->szName ); + hb_errorRT_BASE( EG_NOVAR, 1003, NULL, pMemvarSymb->szName ); } else - hb_errorRT_BASE( EG_NOVAR, 1003, "Unknown variable: ", pMemvarSymb->szName ); + hb_errorRT_BASE( EG_NOVAR, 1003, NULL, pMemvarSymb->szName ); } void hb_MemvarGetRefer( HB_ITEM_PTR pItem, PSYMBOL pMemvarSymb ) @@ -417,10 +420,10 @@ void hb_MemvarGetRefer( HB_ITEM_PTR pItem, PSYMBOL pMemvarSymb ) ++_globalTable[ pDyn->hMemvar ].counter; } else - hb_errorRT_BASE( EG_NOVAR, 1003, "Variable does not exist: ", pMemvarSymb->szName ); + hb_errorRT_BASE( EG_NOVAR, 1003, NULL, pMemvarSymb->szName ); } else - hb_errorRT_BASE( EG_NOVAR, 1003, "Unknown variable: ", pMemvarSymb->szName ); + hb_errorRT_BASE( EG_NOVAR, 1003, NULL, pMemvarSymb->szName ); } /* @@ -446,7 +449,7 @@ static void hb_MemvarCreateFromItem( PHB_ITEM pMemvar, BYTE bScope, PHB_ITEM pVa else if( IS_STRING( pMemvar ) ) pDynVar =hb_GetDynSym( pMemvar->item.asString.value ); else - hb_errorRT_BASE( EG_ARG, 3000, "Argument error: ", "&" ); + hb_errorRT_BASE( EG_ARG, 3000, NULL, "&" ); if( pDynVar ) hb_MemvarCreateFromDynSymbol( pDynVar, bScope, pValue ); @@ -513,7 +516,7 @@ void hb_MemvarRelease( HB_ITEM_PTR pMemvar ) } } else - hb_errorRT_BASE( EG_ARG, 3000, "Argument error: ", "RELEASE" ); + hb_errorRT_BASE( EG_ARG, 3000, NULL, "RELEASE" ); } @@ -539,11 +542,11 @@ void hb_MemvarRelease( HB_ITEM_PTR pMemvar ) * This function can be called either by the harbour compiler or by user. * The compiler always passes the item of IT_SYMBOL type that stores the * name of variable. - * If a variable with the same name exists already then the new + * If a variable with the same name exists already then the new * variable is not created - the previous value remains unchanged. - * If it is first variable with this name then the variable is + * If it is first variable with this name then the variable is * initialized with .T. value. - * + * * $EXAMPLES$ * * $TESTS$ @@ -611,7 +614,7 @@ HARBOUR HB___MVPUBLIC( void ) * If a variable with the same name exists already then the value of old * variable is hidden until the new variable is released. The new variable * is always initialized to NIL value. - * + * * $EXAMPLES$ * * $TESTS$ diff --git a/harbour/source/rtl/msgxxx.c b/harbour/source/rtl/msgxxx.c index 9172be1cc1..fa206ab4a1 100644 --- a/harbour/source/rtl/msgxxx.c +++ b/harbour/source/rtl/msgxxx.c @@ -1,6 +1,8 @@ /* * $Id$ */ +#include "hbdefs.h" +#include "hbsetup.h" #if defined(HARBOUR_LANGUAGE_BAS) #include "natmsg/msgbas.c" diff --git a/harbour/source/rtl/natmsg/msgbas.c b/harbour/source/rtl/natmsg/msgbas.c index 1e4ed7a5d0..220e849bbd 100644 --- a/harbour/source/rtl/natmsg/msgbas.c +++ b/harbour/source/rtl/natmsg/msgbas.c @@ -16,3 +16,65 @@ char *hb_daysname[ 7 ] = { "Igandea", "Astelehena", "Asteartea", "Asteazkena", "Osteguna", "Ostirala", "Larunbata" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgcat.c b/harbour/source/rtl/natmsg/msgcat.c index 6e1e13cc6e..08a7ed340d 100644 --- a/harbour/source/rtl/natmsg/msgcat.c +++ b/harbour/source/rtl/natmsg/msgcat.c @@ -17,3 +17,65 @@ char *hb_daysname[ 7 ] = { "Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Disabte" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgcz852.c b/harbour/source/rtl/natmsg/msgcz852.c index e09252f912..e17e19c8ce 100644 --- a/harbour/source/rtl/natmsg/msgcz852.c +++ b/harbour/source/rtl/natmsg/msgcz852.c @@ -31,3 +31,65 @@ char *hb_daysname[ 7 ] = "ptek", "sobota" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgczkam.c b/harbour/source/rtl/natmsg/msgczkam.c index bfe0491ace..e68db5ff74 100644 --- a/harbour/source/rtl/natmsg/msgczkam.c +++ b/harbour/source/rtl/natmsg/msgczkam.c @@ -31,3 +31,65 @@ char *hb_daysname[ 7 ] = "ptek", "sobota" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgdut.c b/harbour/source/rtl/natmsg/msgdut.c index dc915679cd..ac3cc9c78b 100644 --- a/harbour/source/rtl/natmsg/msgdut.c +++ b/harbour/source/rtl/natmsg/msgdut.c @@ -14,3 +14,65 @@ char *hb_monthsname[ 12 ] = { char *hb_daysname[ 7 ] = { "zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgeo.c b/harbour/source/rtl/natmsg/msgeo.c index 469caca9b3..20a92d0557 100644 --- a/harbour/source/rtl/natmsg/msgeo.c +++ b/harbour/source/rtl/natmsg/msgeo.c @@ -13,3 +13,65 @@ char *hb_daysname[ 7 ] = { "dimanco", "lundo", "mardo", "merkredo", "jaudo", "vendredo", "sabato" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgfre.c b/harbour/source/rtl/natmsg/msgfre.c index 81fbcb62eb..1b5305f13a 100644 --- a/harbour/source/rtl/natmsg/msgfre.c +++ b/harbour/source/rtl/natmsg/msgfre.c @@ -17,3 +17,65 @@ char *hb_daysname[ 7 ] = { "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msggal.c b/harbour/source/rtl/natmsg/msggal.c index 8f17536861..7891fb7680 100644 --- a/harbour/source/rtl/natmsg/msggal.c +++ b/harbour/source/rtl/natmsg/msggal.c @@ -17,3 +17,65 @@ char *hb_daysname[ 7 ] = { "Domingo", "Luns", "Martes", "Mrcores", "Xoves", "Venres", "Sbado" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgger.c b/harbour/source/rtl/natmsg/msgger.c index c8dc9856bc..5b87bbe527 100644 --- a/harbour/source/rtl/natmsg/msgger.c +++ b/harbour/source/rtl/natmsg/msgger.c @@ -15,3 +15,65 @@ char *hb_daysname[ 7 ] = { "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msghu.c b/harbour/source/rtl/natmsg/msghu.c index 690e4b7718..782cd8b19d 100644 --- a/harbour/source/rtl/natmsg/msghu.c +++ b/harbour/source/rtl/natmsg/msghu.c @@ -60,3 +60,65 @@ char *hb_daysname[ 7 ] = "pntek", "szombat" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgia.c b/harbour/source/rtl/natmsg/msgia.c index 0224808fb2..b5f3e78b23 100644 --- a/harbour/source/rtl/natmsg/msgia.c +++ b/harbour/source/rtl/natmsg/msgia.c @@ -15,3 +15,65 @@ char *hb_daysname[ 7 ] = { "Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgita.c b/harbour/source/rtl/natmsg/msgita.c index 47e8f62369..4106eda940 100644 --- a/harbour/source/rtl/natmsg/msgita.c +++ b/harbour/source/rtl/natmsg/msgita.c @@ -17,3 +17,65 @@ char *hb_daysname[ 7 ] = { "Domenica", "Lunedi", "Martedi", "Mercoledi", "Giovedi", "Venerdi", "Sabato" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgkor.c b/harbour/source/rtl/natmsg/msgkor.c index 5517ed464a..caba546bc1 100644 --- a/harbour/source/rtl/natmsg/msgkor.c +++ b/harbour/source/rtl/natmsg/msgkor.c @@ -6,7 +6,7 @@ #include #include - + char *hb_monthsname[ 12 ] = { "1", "2", "3", "4", "5", "6", "7", @@ -17,3 +17,65 @@ char *hb_daysname[ 7 ] = { "Ͽ", "", "ȭ", "", "", "ݿ", "" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgpl852.c b/harbour/source/rtl/natmsg/msgpl852.c index 1d1c6f0e83..fab4723a0e 100644 --- a/harbour/source/rtl/natmsg/msgpl852.c +++ b/harbour/source/rtl/natmsg/msgpl852.c @@ -1,7 +1,7 @@ /* * $Id$ */ -/* Polish language module */ +/* Polish language module - Polskojzyczny modu dla Harbour */ /* Codepage: Latin II - 852 */ char *hb_monthsname[ 12 ] = { @@ -15,4 +15,65 @@ char *hb_daysname[ 7 ] = { "roda", "Czwartek", "Pitek", "Sobota" }; +static char *genericErrors[] = +{ + "Bd bez opisu", + "Nieprawidowy argument", + "Bd zakresu tablicy", + "Za duy string", + "Przepenienie numeryczne", + "Dzielenie przez zero", + "Bd numeryczny", + "Nieprawidowa skadnia", + "Operacja zbyt zoona", + "", + "", + "Za mao pamici", + "Niezdefiniowana funkcja", + "Metoda jest niedostpna", + "Zmienna nie istnieje", + "Alias bazy nie istnieje", + "Zmienna jest niedostpna", + "Nieprawidowy alias bazy", + "Podany alias ju istnieje", + "", + "Bd podczas tworzenia zbioru", + "Bd podczas otwarcia zbioru", + "Bd podczas zamknicia zbioru", + "Bd podczas odczytu ze zbioru", + "Bd podczas zapisu do zbioru", + "Bd wydruku", + "", + "", + "", + "", + "Nieprawidowa operacja", + "Przekroczony limit", + "Uszkodzony indeks bazy", + "Niezgodny typ danych", + "Warto poza zakresem", + "Baza jest nie otwarta", + "Baza nie ma indeksu", + "Wymagany jest wyczny dostp do bazy", + "Wymagana blokada dostpu", + "Zapis niedozwolony", + "Brak blokady dostpu podczas dodawania rekordu", + "Nie udao si zablokowa dostpu", + "", + "", + "", + "Nieprwidowa liczba argumentw", + "pobranie elementu tablicy", + "zmiana wartoci elementu tablicy", + "wymagana jest tablica", + "wymagany typ: logiczny" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgpliso.c b/harbour/source/rtl/natmsg/msgpliso.c new file mode 100644 index 0000000000..f9cff914d3 --- /dev/null +++ b/harbour/source/rtl/natmsg/msgpliso.c @@ -0,0 +1,79 @@ +/* + * $Id$ + */ +/* Polish language module - Polskojzyczny modu dla Harbour */ +/* Codepage: ISO-8859-2 */ + +char *hb_monthsname[ 12 ] = { + "Stycze", "Luty", "Marzec", + "Kwiecie", "Maj", "Czerwiec", "Lipiec", + "Sierpie", "Wrzesie", "Padziernik", + "Listopad", "Grudzie" }; + +char *hb_daysname[ 7 ] = { + "Niedziela", "Poniedziaek", "Wtorek", + "roda", "Czwartek", "Pitek", + "Sobota" }; + +static char *genericErrors[] = +{ + "Bd bez opisu", + "Nieprawidowy argument", + "Bd zakresu tablicy", + "Za duy string", + "Przepenienie numeryczne", + "Dzielenie przez zero", + "Bd numeryczny", + "Nieprawidowa skadnia", + "Operacja zbyt zoona", + "", + "", + "Za mao pamici", + "Niezdefiniowana funkcja", + "Metoda jest niedostpna", + "Zmienna nie istnieje", + "Alias bazy nie istnieje", + "Zmienna jest niedostpna", + "Nieprawidowy alias bazy", + "Podany alias ju istnieje", + "", + "Bd podczas tworzenia zbioru", + "Bd podczas otwarcia zbioru", + "Bd podczas zamknicia zbioru", + "Bd podczas odczytu ze zbioru", + "Bd podczas zapisu do zbioru", + "Bd wydruku", + "", + "", + "", + "", + "Nieprawidowa operacja", + "Przekroczony limit", + "Uszkodzony indeks bazy", + "Niezgodny typ danych", + "Warto poza zakresem", + "Baza jest nie otwarta", + "Baza nie ma indeksu", + "Wymagany jest wyczny dostp do bazy", + "Wymagana blokada dostpu", + "Zapis niedozwolony", + "Brak blokady dostpu podczas dodawania rekordu", + "Nie udao si zablokowa dostpu", + "", + "", + "", + "Nieprwidowa liczba argumentw", + "pobranie elementu tablicy", + "zmiana wartoci elementu tablicy", + "wymagana jest tablica", + "wymagany typ: logiczny" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} + diff --git a/harbour/source/rtl/natmsg/msgplmaz.c b/harbour/source/rtl/natmsg/msgplmaz.c index 2e5d6ed37a..e5ef73c0a2 100644 --- a/harbour/source/rtl/natmsg/msgplmaz.c +++ b/harbour/source/rtl/natmsg/msgplmaz.c @@ -1,8 +1,8 @@ /* * $Id$ */ -/* Polish language module */ -/* Codepage: Polish - Mazovia */ +/* Polish language module - Polskojzyczny modu dla Harbour */ +/* Codepage: Mazowia */ char *hb_monthsname[ 12 ] = { "Stycze", "Luty", "Marzec", @@ -15,4 +15,65 @@ char *hb_daysname[ 7 ] = { "roda", "Czwartek", "Pitek", "Sobota" }; +static char *genericErrors[] = +{ + "Bd bez opisu", + "Nieprawidowy argument", + "Bd zakresu tablicy", + "Za duy string", + "Przepenienie numeryczne", + "Dzielenie przez zero", + "Bd numeryczny", + "Nieprawidowa skadnia", + "Operacja zbyt zoona", + "", + "", + "Za mao pamici", + "Niezdefiniowana funkcja", + "Metoda jest niedostpna", + "Zmienna nie istnieje", + "Alias bazy nie istnieje", + "Zmienna jest niedostpna", + "Nieprawidowy alias bazy", + "Podany alias ju istnieje", + "", + "Bd podczas tworzenia zbioru", + "Bd podczas otwarcia zbioru", + "Bd podczas zamknicia zbioru", + "Bd podczas odczytu ze zbioru", + "Bd podczas zapisu do zbioru", + "Bd wydruku", + "", + "", + "", + "", + "Nieprawidowa operacja", + "Przekroczony limit", + "Uszkodzony indeks bazy", + "Niezgodny typ danych", + "Warto poza zakresem", + "Baza jest nie otwarta", + "Baza nie ma indeksu", + "Wymagany jest wyczny dostp do bazy", + "Wymagana blokada dostpu", + "Zapis niedozwolony", + "Brak blokady dostpu podczas dodawania rekordu", + "Nie udao si zablokowa dostpu", + "", + "", + "", + "Nieprwidowa liczba argumentw", + "pobranie elementu tablicy", + "zmiana wartoci elementu tablicy", + "wymagana jest tablica", + "wymagany typ: logiczny" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgpor.c b/harbour/source/rtl/natmsg/msgpor.c index 1572c2fda0..1d66abdeb6 100644 --- a/harbour/source/rtl/natmsg/msgpor.c +++ b/harbour/source/rtl/natmsg/msgpor.c @@ -16,3 +16,64 @@ char *hb_daysname[ 7 ] = { "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sbado" }; +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgr1251.c b/harbour/source/rtl/natmsg/msgr1251.c index 782029e3d9..65b357541b 100644 --- a/harbour/source/rtl/natmsg/msgr1251.c +++ b/harbour/source/rtl/natmsg/msgr1251.c @@ -15,3 +15,65 @@ char *hb_daysname[ 7 ] = { "", "", "", "", "", "", "" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgru866.c b/harbour/source/rtl/natmsg/msgru866.c index b8b581466a..27880a835b 100644 --- a/harbour/source/rtl/natmsg/msgru866.c +++ b/harbour/source/rtl/natmsg/msgru866.c @@ -15,3 +15,65 @@ char *hb_daysname[ 7 ] = { "ᥭ", "쭨", "୨", "।", "⢥", "⭨", "㡡" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgspa.c b/harbour/source/rtl/natmsg/msgspa.c index c57b4c50f6..93f5a84358 100644 --- a/harbour/source/rtl/natmsg/msgspa.c +++ b/harbour/source/rtl/natmsg/msgspa.c @@ -13,3 +13,64 @@ char *hb_daysname[ 7 ] = { "Mircoles", "Jueves", "Viernes", "Sbado" }; +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msguk.c b/harbour/source/rtl/natmsg/msguk.c index 87e698ce8b..9a78a5607d 100644 --- a/harbour/source/rtl/natmsg/msguk.c +++ b/harbour/source/rtl/natmsg/msguk.c @@ -15,3 +15,65 @@ char *hb_daysname[ 7 ] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/natmsg/msgyu852.c b/harbour/source/rtl/natmsg/msgyu852.c index 90aa88c750..9035934d53 100644 --- a/harbour/source/rtl/natmsg/msgyu852.c +++ b/harbour/source/rtl/natmsg/msgyu852.c @@ -31,3 +31,65 @@ char *hb_daysname[ 7 ] = "petak", "subota" }; + +static char *genericErrors[] = +{ + "Unknown error", + "Argument error", + "Bound error", + "String overflow", + "Numeric overflow", + "Divide by zero", + "Numeric error", + "Syntax error", + "Operation too complex", + "", + "", + "Memory low", + "Undefined function", + "No exported method", + "Variable does not exists", + "Alias does not exists", + "No exported variable", + "Incorrect alias name", + "Duplicated alias name", + "", + "Create error", + "Open error", + "Close error", + "Read error", + "Write error", + "Print error", + "", + "", + "", + "", + "Unsupported operation", + "Limit exeeded", + "Index corruption detected", + "Incorrect type of data", + "Data width too long", + "Workarea not in use", + "Workarea not indexed", + "Exclusive use required", + "Lock required", + "Write not allowed", + "Append lock failed", + "Lock failure", + "", + "", + "", + "Incorrect number of arguments", + "array access", + "array assign", + "not an array", + "conditional" +}; + +char *hb_ErrorNatDescription( ULONG ulGenError ) +{ + if( ulGenError <= sizeof(genericErrors)/sizeof(char*) ) + return genericErrors[ ulGenError ]; + else + return genericErrors[ 0 ]; +} diff --git a/harbour/source/rtl/set.c b/harbour/source/rtl/set.c index 7e21ddef09..b2798824db 100644 --- a/harbour/source/rtl/set.c +++ b/harbour/source/rtl/set.c @@ -33,7 +33,7 @@ in call to hb_setColor() to account for no or NIL parameters. V 1.48 David G. Holm Simplified SET_COLOR handling. - Made changes to deal with the + Made changes to deal with the hb_set.HB_SET_COLOR string having a fixed 64 byte size. V 1.46 Paul Tucker Modifed SetColor handling. @@ -310,7 +310,7 @@ static int open_handle (char * file_name, BOOL bMode, char * def_ext) S_IWRITE ); if (handle < 0) { - hb_errorRT_TERMINAL( EG_CREATE, 2013, "Create error", path ); + hb_errorRT_TERMINAL( EG_CREATE, 2013, NULL, path ); } return handle; #endif @@ -701,7 +701,7 @@ HARBOUR HB_SET (void) { if (set_number (pArg2, hb_set.HB_SET_DECIMALS) < 0) { - hb_errorRT_BASE(EG_ARG, 2020, "Argument error", "SET"); + hb_errorRT_BASE(EG_ARG, 2020, NULL, "SET"); } else { @@ -745,7 +745,7 @@ HARBOUR HB_SET (void) { if (set_number (pArg2, hb_set.HB_SET_EPOCH) < 0) { - hb_errorRT_BASE(EG_ARG, 2020, "Argument error", "SET"); + hb_errorRT_BASE(EG_ARG, 2020, NULL, "SET"); } else { @@ -808,7 +808,7 @@ HARBOUR HB_SET (void) { if (set_number (pArg2, hb_set.HB_SET_MARGIN) < 0) { - hb_errorRT_BASE(EG_ARG, 2020, "Argument error", "SET"); + hb_errorRT_BASE(EG_ARG, 2020, NULL, "SET"); } else { @@ -826,7 +826,7 @@ HARBOUR HB_SET (void) { if (set_number (pArg2, hb_set.HB_SET_MESSAGE) < 0) { - hb_errorRT_BASE(EG_ARG, 2020, "Argument error", "SET"); + hb_errorRT_BASE(EG_ARG, 2020, NULL, "SET"); } else { diff --git a/harbour/source/rtl/strings.c b/harbour/source/rtl/strings.c index 5fa5c530a7..83e5d637c9 100644 --- a/harbour/source/rtl/strings.c +++ b/harbour/source/rtl/strings.c @@ -180,13 +180,13 @@ HARBOUR HB_LTRIM( void ) } else { - hb_errorRT_BASE(EG_ARG, 1101, "Argument error", "LTRIM"); + hb_errorRT_BASE(EG_ARG, 1101, NULL, "LTRIM"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1101, "Incorrect number of arguments", "LTRIM"); + hb_errorRT_BASE(EG_ARGCOUNT, 1101, NULL, "LTRIM"); } } @@ -225,14 +225,14 @@ HARBOUR HB_RTRIM( void ) /* Clipper doesn't error, but only in RTRIM. TRIM() throws an error, though */ hb_retc(""); #else - hb_errorRT_BASE(EG_ARG, 1100, "Argument error", "RTRIM"); + hb_errorRT_BASE(EG_ARG, 1100, NULL, "RTRIM"); #endif } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1100, "Incorrect number of arguments", "RTRIM"); + hb_errorRT_BASE(EG_ARGCOUNT, 1100, NULL, "RTRIM"); } } @@ -249,13 +249,13 @@ HARBOUR HB_TRIM( void ) } else { - hb_errorRT_BASE(EG_ARG, 1100, "Argument error", "TRIM"); + hb_errorRT_BASE(EG_ARG, 1100, NULL, "TRIM"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1100, "Incorrect number of arguments", "TRIM"); + hb_errorRT_BASE(EG_ARGCOUNT, 1100, NULL, "TRIM"); } } @@ -499,13 +499,13 @@ HARBOUR HB_AT( void ) } else { - hb_errorRT_BASE(EG_ARG, 1108, "Argument error", "AT"); + hb_errorRT_BASE(EG_ARG, 1108, NULL, "AT"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1108, "Incorrect number of arguments", "AT"); + hb_errorRT_BASE(EG_ARGCOUNT, 1108, NULL, "AT"); } } @@ -558,13 +558,13 @@ HARBOUR HB_CHR( void ) } else { - hb_errorRT_BASE(EG_ARG, 1104, "Argument error", "CHR"); + hb_errorRT_BASE(EG_ARG, 1104, NULL, "CHR"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1104, "Incorrect number of arguments", "CHR"); + hb_errorRT_BASE(EG_ARGCOUNT, 1104, NULL, "CHR"); } } @@ -584,13 +584,13 @@ HARBOUR HB_ASC(void) } else { - hb_errorRT_BASE(EG_ARG, 1107, "Argument error", "ASC"); + hb_errorRT_BASE(EG_ARG, 1107, NULL, "ASC"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1107, "Incorrect number of arguments", "ASC"); + hb_errorRT_BASE(EG_ARGCOUNT, 1107, NULL, "ASC"); } } @@ -619,18 +619,18 @@ HARBOUR HB_LEFT( void ) } else { - hb_errorRT_BASE(EG_ARG, 1124, "Argument error", "LEFT"); + hb_errorRT_BASE(EG_ARG, 1124, NULL, "LEFT"); } } else { - hb_errorRT_BASE(EG_ARG, 1124, "Argument error", "LEFT"); + hb_errorRT_BASE(EG_ARG, 1124, NULL, "LEFT"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1124, "Incorrect number of arguments", "LEFT"); + hb_errorRT_BASE(EG_ARGCOUNT, 1124, NULL, "LEFT"); } } @@ -725,13 +725,13 @@ HARBOUR HB_SUBSTR( void ) } else { - hb_errorRT_BASE(EG_ARG, 1110, "Argument error", "SUBSTR"); + hb_errorRT_BASE(EG_ARG, 1110, NULL, "SUBSTR"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1110, "Incorrect number of arguments", "SUBSTR"); + hb_errorRT_BASE(EG_ARGCOUNT, 1110, NULL, "SUBSTR"); } } @@ -759,13 +759,13 @@ HARBOUR HB_LOWER( void ) } else { - hb_errorRT_BASE(EG_ARG, 1103, "Argument error", "LOWER"); + hb_errorRT_BASE(EG_ARG, 1103, NULL, "LOWER"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1103, "Incorrect number of arguments", "LOWER"); + hb_errorRT_BASE(EG_ARGCOUNT, 1103, NULL, "LOWER"); } } @@ -793,13 +793,13 @@ HARBOUR HB_UPPER( void ) } else { - hb_errorRT_BASE(EG_ARG, 1102, "Argument error", "UPPER"); + hb_errorRT_BASE(EG_ARG, 1102, NULL, "UPPER"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1102, "Incorrect number of arguments", "UPPER"); + hb_errorRT_BASE(EG_ARGCOUNT, 1102, NULL, "UPPER"); } } @@ -831,7 +831,7 @@ HARBOUR HB_REPLICATE( void ) } /* TODO: Check for string overflow */ - /* hb_errorRT_BASE(EG_ARG, 1234, "String overflow", "REPLICATE"); */ + /* hb_errorRT_BASE(EG_STROVERFLOW, 1234, NULL, "REPLICATE"); */ hb_retclen(szResult, lLen * lTimes); hb_xfree(szResult); @@ -841,13 +841,13 @@ HARBOUR HB_REPLICATE( void ) } else { - hb_errorRT_BASE(EG_ARG, 1106, "Argument error", "REPLICATE"); + hb_errorRT_BASE(EG_ARG, 1106, NULL, "REPLICATE"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1106, "Incorrect number of arguments", "REPLICATE"); + hb_errorRT_BASE(EG_ARGCOUNT, 1106, NULL, "REPLICATE"); } } @@ -868,7 +868,7 @@ HARBOUR HB_SPACE( void ) char *szResult = (char *)hb_xgrab(lLen + 1); /* TODO: Check for string overflow */ - /* hb_errorRT_BASE(EG_ARG, 1233, "String overflow", "SPACE"); */ + /* hb_errorRT_BASE(EG_STROVERFLOW, 1233, NULL, "SPACE"); */ memset(szResult, ' ', lLen); hb_retclen(szResult, lLen); @@ -879,13 +879,13 @@ HARBOUR HB_SPACE( void ) } else { - hb_errorRT_BASE(EG_ARG, 1105, "Argument error", "SPACE"); + hb_errorRT_BASE(EG_ARG, 1105, NULL, "SPACE"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1105, "Incorrect number of arguments", "SPACE"); + hb_errorRT_BASE(EG_ARGCOUNT, 1105, NULL, "SPACE"); } } @@ -1112,13 +1112,13 @@ HARBOUR HB_VAL( void ) } else { - hb_errorRT_BASE(EG_ARG, 1098, "Argument error", "VAL"); + hb_errorRT_BASE(EG_ARG, 1098, NULL, "VAL"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1098, "Incorrect number of arguments", "VAL"); + hb_errorRT_BASE(EG_ARGCOUNT, 1098, NULL, "VAL"); } } @@ -1264,12 +1264,12 @@ HARBOUR HB_STR( void ) } else { - hb_errorRT_BASE(EG_ARG, 1099, "Argument error", "STR"); + hb_errorRT_BASE(EG_ARG, 1099, NULL, "STR"); } } else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARG, 1099, "Incorrect number of arguments", "STR"); + hb_errorRT_BASE(EG_ARGCOUNT, 1099, NULL, "STR"); } } diff --git a/harbour/source/rtl/transfrm.c b/harbour/source/rtl/transfrm.c index e0ba85a4da..19197ab0e7 100644 --- a/harbour/source/rtl/transfrm.c +++ b/harbour/source/rtl/transfrm.c @@ -599,7 +599,7 @@ HARBOUR HB_TRANSFORM( void ) } default: { - hb_errorRT_BASE(EG_ARG, 1122, "Argument error", "TRANSFORM"); + hb_errorRT_BASE(EG_ARG, 1122, NULL, "TRANSFORM"); } } } @@ -647,7 +647,7 @@ HARBOUR HB_TRANSFORM( void ) } default: { - hb_errorRT_BASE(EG_ARG, 1122, "Argument error", "TRANSFORM"); + hb_errorRT_BASE(EG_ARG, 1122, NULL, "TRANSFORM"); } } } diff --git a/harbour/source/tools/dates2.c b/harbour/source/tools/dates2.c index 413b130f10..786bf709cd 100644 --- a/harbour/source/tools/dates2.c +++ b/harbour/source/tools/dates2.c @@ -29,10 +29,10 @@ their web site at http://www.gnu.org/). You can contact me at: dezac@corevia.com - + The following functions are Copyright 1999 Jose Lalin : hb_isleapyear(), hb_daysinmonth(), hb_doy(), hb_wom(), hb_woy() - HB_AMONTHS(), HB_ADAYS(), HB_ISLEAPYEAR(), HB_DAYSINMONTH(), + HB_AMONTHS(), HB_ADAYS(), HB_ISLEAPYEAR(), HB_DAYSINMONTH(), HB_EOM(), HB_BOM(), HB_WOM(), HB_DOY(), HB_WOY(), HB_EOY(), HB_BOY() */ @@ -179,7 +179,7 @@ HARBOUR HB_ISLEAPYEAR( void ) } else { - hb_errorRT_BASE(EG_ARG, 9999, "Argument error", "ISLEAPYEAR"); + hb_errorRT_BASE(EG_ARG, 9999, NULL, "ISLEAPYEAR"); } } diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 88e31d5780..c430f657d7 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -667,7 +667,7 @@ void And( void ) } else { - hb_errorRT_BASE(EG_ARG, 1066, "Argument error", "conditional"); + hb_errorRT_BASE(EG_ARG, 1066, NULL, ".AND."); } } @@ -919,7 +919,7 @@ void Equal( BOOL bExact ) else if( pItem1->type != pItem2->type ) { - hb_errorRT_BASE(EG_ARG, 1070, "Argument error", "=="); + hb_errorRT_BASE(EG_ARG, 1070, NULL, "=="); } else @@ -1053,7 +1053,7 @@ void Greater( void ) else if( ( stack.pPos - 2 )->type != ( stack.pPos - 1 )->type ) { - hb_errorRT_BASE(EG_ARG, 1075, "Argument error", ">"); + hb_errorRT_BASE(EG_ARG, 1075, NULL, ">"); } } @@ -1099,7 +1099,7 @@ void GreaterEqual( void ) else if( ( stack.pPos - 2 )->type != ( stack.pPos - 1 )->type ) { - hb_errorRT_BASE(EG_ARG, 1076, "Argument error", ">="); + hb_errorRT_BASE(EG_ARG, 1076, NULL, ">="); } } @@ -1121,7 +1121,7 @@ void Inc( void ) } else { - hb_errorRT_BASE(EG_ARG, 1086, "Argument error", "++"); + hb_errorRT_BASE(EG_ARG, 1086, NULL, "++"); } } @@ -1167,7 +1167,7 @@ void Instring( void ) } else { - hb_errorRT_BASE(EG_ARG, 1109, "Argument error", "$"); + hb_errorRT_BASE(EG_ARG, 1109, NULL, "$"); } } @@ -1279,7 +1279,7 @@ void Less( void ) else if( ( stack.pPos - 2 )->type != ( stack.pPos - 1 )->type ) { - hb_errorRT_BASE(EG_ARG, 1073, "Argument error", "<"); + hb_errorRT_BASE(EG_ARG, 1073, NULL, "<"); } } @@ -1325,7 +1325,7 @@ void LessEqual( void ) else if( ( stack.pPos - 2 )->type != ( stack.pPos - 1 )->type ) { - hb_errorRT_BASE(EG_ARG, 1074, "Argument error", "<="); + hb_errorRT_BASE(EG_ARG, 1074, NULL, "<="); } } @@ -1365,7 +1365,7 @@ void Not( void ) if( IS_LOGICAL( pItem ) ) pItem->item.asLogical.value = ! pItem->item.asLogical.value; else - hb_errorRT_BASE(EG_ARG, 1077, "Argument error", ".NOT."); + hb_errorRT_BASE(EG_ARG, 1077, NULL, ".NOT."); } void NotEqual( void ) @@ -1408,7 +1408,7 @@ void NotEqual( void ) else if( pItem1->type != pItem2->type ) { - hb_errorRT_BASE(EG_ARG, 1072, "Argument error", "<>"); + hb_errorRT_BASE(EG_ARG, 1072, NULL, "<>"); } else @@ -1478,7 +1478,7 @@ void Minus( void ) else if( IS_OBJECT( stack.pPos - 2 ) && hb_isMessage( stack.pPos - 2, "-" ) ) OperatorCall( stack.pPos - 2, stack.pPos - 1, "-" ); else - hb_errorRT_BASE(EG_ARG, 1082, "Argument error", "-"); + hb_errorRT_BASE(EG_ARG, 1082, NULL, "-"); } @@ -1523,7 +1523,7 @@ void Or( void ) } else { - hb_errorRT_BASE(EG_ARG, 1066, "Argument error", "conditional"); + hb_errorRT_BASE(EG_ARG, 1066, NULL, ".OR."); } } @@ -1578,7 +1578,7 @@ void Plus( void ) OperatorCall( pItem1, pItem2, "+" ); else - hb_errorRT_BASE( EG_ARG, 1081, "Types of arguments do not match", "+" ); + hb_errorRT_BASE( EG_DATATYPE, 1081, NULL, "+" ); HB_DEBUG( "Plus\n" ); } @@ -1657,18 +1657,13 @@ void PopLocal( SHORT iLocal ) int PopLogical( void ) { - PHB_ITEM pError; - StackPop(); if( IS_LOGICAL( stack.pPos ) ) return stack.pPos->item.asLogical.value; else { - pError = hb_errNew(); - hb_errPutDescription( pError, "Argument error: conditional" ); - hb_errLaunch( pError ); - hb_errRelease( pError ); + hb_errorRT_BASE(EG_ARG, 1066, NULL, hb_ErrorNatDescription(EG_CONDITION)); return 0; } } @@ -2143,7 +2138,7 @@ void ProcessSymbols( PSYMBOL pModuleSymbols, WORD wModuleSymbols ) /* module sym pSymStart = pModuleSymbols + w; /* first public defined symbol to start execution */ if( ( ( pModuleSymbols + w )->cScope == FS_PUBLIC ) || - ( ( pModuleSymbols + w )->cScope & ( FS_MESSAGE | VS_MEMVAR ) ) ) + ( ( pModuleSymbols + w )->cScope & ( FS_MESSAGE | FS_MEMVAR ) ) ) hb_NewDynSym( pModuleSymbols + w ); } } @@ -2242,7 +2237,7 @@ HARBOUR HB_LEN( void ) break; default: - hb_errorRT_BASE(EG_ARG, 1111, "Argument error", "LEN"); + hb_errorRT_BASE(EG_ARG, 1111, NULL, "LEN"); break; } } @@ -2425,11 +2420,6 @@ HARBOUR HB_PVALUE(void) /* PValue( ) hb_itemReturn( pBase + 1 + wParam ); else { - PHB_ITEM pError = hb_errNew(); - - hb_errPutDescription(pError, "Argument error: PVALUE"); - hb_errLaunch(pError); - hb_errRelease(pError); - hb_ret(); + hb_errorRT_BASE(EG_ARG, 1082, NULL, "PVALUE"); } } diff --git a/harbour/tests/working/Makefile b/harbour/tests/working/Makefile index 039188730a..900af62262 100644 --- a/harbour/tests/working/Makefile +++ b/harbour/tests/working/Makefile @@ -134,5 +134,6 @@ LIBS=\ tools \ vm \ rtl \ + rdd \ include $(TOP)$(ROOT)config/test.cf