From 1c2a05a9bffbfe8e620fec7a6babfe6328ee27d8 Mon Sep 17 00:00:00 2001 From: Ryszard Glab Date: Mon, 2 Aug 1999 04:42:10 +0000 Subject: [PATCH] ChangeLog 19990802-06:30 --- harbour/ChangeLog | 55 ++ harbour/config/dos/djgpp.cf | 2 + harbour/config/linux/gcc.cf | 4 +- harbour/doc/subcodes.txt | 1337 +++++++++++++++++++++++++++++ harbour/include/errorapi.h | 2 + harbour/include/hberrors.h | 2 +- harbour/source/compiler/harbour.y | 45 +- harbour/source/rtl/Makefile | 1 + harbour/source/rtl/classes.c | 4 +- harbour/source/rtl/dates.c | 12 +- harbour/source/rtl/do.c | 84 ++ harbour/source/rtl/errorapi.c | 23 + harbour/source/rtl/files.c | 2 +- harbour/source/rtl/inkey.c | 2 +- harbour/source/rtl/math.c | 16 +- harbour/source/rtl/memvars.c | 4 +- harbour/source/rtl/strings.c | 32 +- harbour/source/tools/dates2.c | 2 +- harbour/source/tools/strfmt.c | 2 +- harbour/source/vm/hvm.c | 4 +- harbour/source/vm/initsymb.c | 9 +- 21 files changed, 1590 insertions(+), 54 deletions(-) create mode 100644 harbour/doc/subcodes.txt create mode 100644 harbour/source/rtl/do.c diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a9b67774a9..9101a403fa 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,58 @@ +19990802-06:30 GMT+2 Ryszard Glab + + *source/tools/strfmt.c + * added (char *) type cast to call for hb_xgrab() + + *config/dos/djgpp.cf + *config/linux/gcc.cf + * changed to link correctly regardless the libraries order + (the GCC linker searches the library only once by default) + + *source/rtl/classes.c + *source/rtl/dates.c + *source/rtl/files.c + *source/rtl/inkey.c + *source/rtl/math.c + *source/rtl/memvars.c + *source/rtl/strings.c + *source/tools/dates2.c + *source/vm/hvm.c + * changed numbering of error subcodes + + *source/rtl/errorapi.c + + added hb_errorRT_TOOLS() function + + *include/errorapi.h + + added definition of HB_ERR_SS_TOOLS + + added hb_errorRT_TOOLS() function + + *doc/subcodes.txt + + added new file with proposed format for documenting of used + error subcodes. + + *include/hberors.h + + added new error code ERR_INVALID_LVALUE + + *source/compiler/harbour.y + + added new error 'invalid lvalue' generated in cases like: + alias->(var1, var2) := 0 + + enhanced support for DO WITH statement - procedure is + called however variables are nnot passed by reference yet + + *source/vm/initsymb.c + + updated systems symbols' table with HB_DO function + + *source/rtl/do.c + + added new HARBOUR HB_DO function (visible in harbour as 'DO') + that calls passed function/procedure. + This function can be called directly passing the string with + function/procedure name or passing a codeblock. + This function is also used to implement DO WITH + statement + + *source/rtl/Makefile + + added new file do.c + 19990801-21:58 GMT+1 Victor Szel % source/rtl/descend.c #include removed diff --git a/harbour/config/dos/djgpp.cf b/harbour/config/dos/djgpp.cf index 785a675ab9..cb60fa8168 100644 --- a/harbour/config/dos/djgpp.cf +++ b/harbour/config/dos/djgpp.cf @@ -24,6 +24,7 @@ LINKPATHS += $(foreach lib, $(LIBS), -L$(TOP)$(ROOT)source/$(lib)/$(ARCH)) else LINKPATHS += -L$(HB_LIB_COMPILE) endif +LINKLIBS += -Wl,-( LINKLIBS += $(foreach lib, $(LIBS), -l$(lib)) # If LIBS specifies the rdd library, add all DB drivers. @@ -32,6 +33,7 @@ LINKPATHS += $(foreach drv, $(HB_DB_DRIVERS), -L$(TOP)$(ROOT)source/rdd/$(drv)/$ LINKLIBS += $(foreach drv, $(HB_DB_DRIVERS), -l$(drv)) endif +LINKLIBS += -Wl,-) LDFLAGS = $(LINKPATHS) # Note: The empty line directly before 'endef' HAVE TO exist! diff --git a/harbour/config/linux/gcc.cf b/harbour/config/linux/gcc.cf index 8cbdb168f9..3fe21c06b3 100644 --- a/harbour/config/linux/gcc.cf +++ b/harbour/config/linux/gcc.cf @@ -24,6 +24,7 @@ LINKPATHS += $(foreach lib, $(LIBS), -L$(TOP)$(ROOT)source/$(lib)/$(ARCH)) else LINKPATHS += -L$(HB_LIB_COMPILE) endif +LINKLIBS += -Wl,--start-group LINKLIBS += $(foreach lib, $(LIBS), -l$(lib)) # If LIBS specifies the rdd library, add all DB drivers. @@ -32,8 +33,7 @@ LINKPATHS += $(foreach drv, $(HB_DB_DRIVERS), -L$(TOP)$(ROOT)source/rdd/$(drv)/$ LINKLIBS += $(foreach drv, $(HB_DB_DRIVERS), -l$(drv)) endif -LINKLIBS += -lm - +LINKLIBS += -lm -Wl,--end-group LDFLAGS = $(LINKPATHS) AR = ar diff --git a/harbour/doc/subcodes.txt b/harbour/doc/subcodes.txt new file mode 100644 index 0000000000..fa509cbdf3 --- /dev/null +++ b/harbour/doc/subcodes.txt @@ -0,0 +1,1337 @@ + Proposition: + + * If the error is raised in the same condition as in Clipper then the same + subcode number should be used. + +* Errors specific to the Harbour and generated in RTL modules should +start from 3000 + +* Errors generated in tools functions should start from 4000 + +/* ************************************************************************** */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1003 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Attempt to acces nonexisting or hidden variable + * $DESCRIPTION$ + * The specified variable was not found. + * If it is a database field make sure that the required database is open. + * If it is a private or public variable then you must first create it + * using PRIVATE or PUBLIC statement + * $FUNCTION$ + * + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1068 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of argument + * $DESCRIPTION$ + * The used data is not of logical type + * $FUNCTION$ + * + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1068 + * $CATEGORY$ + * arrays + * $ONELINER$ + * Bound error in array access + * $DESCRIPTION$ + * The attempt to retrieve data from non-array value + * $FUNCTION$ + * + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1069 + * $CATEGORY$ + * arrays + * $ONELINER$ + * Bound error in array access + * $DESCRIPTION$ + * The attempt to set data to non-array value + * $FUNCTION$ + * + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1078 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of arguments + * $DESCRIPTION$ + * The type of compared arguments do not match + * $FUNCTION$ + * == + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1072 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of arguments + * $DESCRIPTION$ + * The type of compared arguments do not match + * $FUNCTION$ + * <> + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1073 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of arguments + * $DESCRIPTION$ + * The type of compared arguments do not match + * $FUNCTION$ + * < + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1074 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of arguments + * $DESCRIPTION$ + * The type of compared arguments do not match + * $FUNCTION$ + * <= + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1075 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of arguments + * $DESCRIPTION$ + * The type of compared arguments do not match + * $FUNCTION$ + * > + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1076 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of arguments + * $DESCRIPTION$ + * The type of compared arguments do not match + * $FUNCTION$ + * >= + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1077 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of arguments + * $DESCRIPTION$ + * Operation is not allowed for passed argument. The argument is not + * a logical value. + * $FUNCTION$ + * ! + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1078 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of arguments + * $DESCRIPTION$ + * The type of one or both arguments is not a logical + * $FUNCTION$ + * .AND. + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1079 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of arguments + * $DESCRIPTION$ + * The type of one or both arguments is not a logical + * $FUNCTION$ + * .OR. + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1076 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of arguments + * $DESCRIPTION$ + * The value of argument cannot be incremented + * $FUNCTION$ + * ++ + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1081 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of arguments + * $DESCRIPTION$ + * The plus operation is not allowed for used arguments. + * $FUNCTION$ + * + + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1082 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of arguments + * $DESCRIPTION$ + * The minus operation is not allowed for used arguments. + * $FUNCTION$ + * - + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1100 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Incorrect type of argument + * $DESCRIPTION$ + * The specified argument is not a string. + * $FUNCTION$ + * RTRIM, TRIM + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1101 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Incorrect type of argument + * $DESCRIPTION$ + * The specified argument is not a string. + * $FUNCTION$ + * LTRIM + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1102 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The first argument passed to a function is not a string. + * $FUNCTION$ + * UPPER + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1103 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The first argument passed to a function is not a string. + * $FUNCTION$ + * LOWER + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1104 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Incorrect type of argument + * $DESCRIPTION$ + * The specified argument is not a numeric value. + * $FUNCTION$ + * CHR + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1105 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The arguments passed to a function are of incorrect type. + * $FUNCTION$ + * SPACE + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1106 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The arguments passed to a function are of incorrect type. + * $FUNCTION$ + * REPLICATE + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1107 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Incorrect type of argument + * $DESCRIPTION$ + * The specified argument is not a string. + * $FUNCTION$ + * ASC + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1108 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Incorrect type of argument + * $DESCRIPTION$ + * The specified argument is not a string. + * $FUNCTION$ + * AT + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1076 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of arguments + * $DESCRIPTION$ + * The arguments of '$' operator are not a strings. + * $FUNCTION$ + * $ + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1110 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The first argument passed to a function is not a string. + * $FUNCTION$ + * SUBSTR + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1110 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The passed argument is neither a string nor an array. + * $FUNCTION$ + * LEN + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + + /* $DOC$ + * $SUBCODE$ + * BASE/1112 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function are of incorrect + * type + * $FUNCTION$ + * YEAR + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1113 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function are of incorrect + * type + * $FUNCTION$ + * MONTH + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1114 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function are of incorrect + * type + * $FUNCTION$ + * DAY + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1115 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function are of incorrect + * type + * $FUNCTION$ + * DOW + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1116 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function are of incorrect + * type + * $FUNCTION$ + * CMONTH + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1117 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function is of incorrect + * type + * $FUNCTION$ + * CDOW + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1120 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function is of incorrect + * type + * $FUNCTION$ + * DTOS + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1122 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Incorrect type of argument + * $DESCRIPTION$ + * The argument (or arguments) passed to a function is of incorrect + * type + * $FUNCTION$ + * TRANSFORM + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1124 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Incorrect type of argument + * $DESCRIPTION$ + * The first argument is not a string. + * $FUNCTION$ + * LEFT + * $STATUS$ + * Clipper + * $SEEALSO$ + * BASE/3009 + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1126 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The first arguments passed to a function is not a string. + * $FUNCTION$ + * STRTRAN + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1132 + * $CATEGORY$ + * arrays + * $ONELINER$ + * Bound error in array access + * $DESCRIPTION$ + * The specified index into an array was greater then the number of + * elements in the array. + * $FUNCTION$ + * + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1133 + * $CATEGORY$ + * arrays + * $ONELINER$ + * Bound error in array assigment + * $DESCRIPTION$ + * The specified index into an array was greater then the number of + * elements in the array. + * $FUNCTION$ + * + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1068 + * $CATEGORY$ + * arrays + * $ONELINER$ + * Bound error in array element assigment + * $DESCRIPTION$ + * The specified index into an array was greater then the number of + * elements in the array. + * $FUNCTION$ + * + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ +/* $DOC$ + * $SUBCODE$ + * BASE/1085 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function is not an numeric + * value + * $FUNCTION$ + * MOD + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1089 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function is not an numeric + * value + * $FUNCTION$ + * ABS + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1090 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function is not an numeric + * value + * $FUNCTION$ + * INT + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1092 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function is not an numeric + * value + * $FUNCTION$ + * MIN + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1093 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function is not an numeric + * value + * $FUNCTION$ + * MAX + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1094 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function is not an numeric + * value + * $FUNCTION$ + * ROUND + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1095 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function is not an numeric + * value + * $FUNCTION$ + * LOG + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1096 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function is not an numeric + * value + * $FUNCTION$ + * EXP + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1097 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function is not an numeric + * value + * $FUNCTION$ + * SQRT + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1098 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function is not a string + * value + * $FUNCTION$ + * VAL + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/1099 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The argument (or arguments) passed to a function is not a numeric + * value + * $FUNCTION$ + * STR + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* ************************************************************************** */ + +/* $DOC$ + * $SUBCODE$ + * BASE/2010 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Incorrect arguments type + * $DESCRIPTION$ + * Passed arguments was not strings with filenames to copy/ + * $FUNCTION$ + * __COPYFILE + * $COMPLIANCE$ + * Harbour specific + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/2012 + * $CATEGORY$ + * files + * $ONELINER$ + * File error + * $DESCRIPTION$ + * An error has occured during the attempt to open, create or write + * during copy operation + * $FUNCTION$ + * __COPYFILE + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/2017 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to a function + * $DESCRIPTION$ + * The first argument is not an array or/and the second argument + * is not a code block + * $FUNCTION$ + * AEVAL + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/2020 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The passed value is negative. Only values > 0 are allowed. + * $FUNCTION$ + * SET DECIMALS + * SET EPOCH + * SET MARGIN + * SET MESSAGE + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ + +/* ************************************************************************** */ + +/* $DOC$ + * $SUBCODE$ + * BASE/3000 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Incorrect number of arguments + * $DESCRIPTION$ + * The number of arguments passed to a function is incorrect + * $FUNCTION$ + * DTOS + * $STATUS$ + * Harbour specific + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/3001 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Incorrect argument type + * $DESCRIPTION$ + * The passed argument is not an object. Only data of type OBJECT + * can be cloned by this function + * $FUNCTION$ + * OCLONE + * $STATUS$ + * Harbour specific + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/3002 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Super class does not return an object + * $DESCRIPTION$ + * Passed argument is not a name of defined class or specified class + * doesn't have a super class + * $FUNCTION$ + * __INSTSUPER + * $STATUS$ + * Harbour specific + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/3003 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Cannot find super class + * $DESCRIPTION$ + * Passed argument is not a name of defined class + * $FUNCTION$ + * __INSTSUPER + * $STATUS$ + * Harbour specific + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/3004 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Cannot modify a DATA item in a class + * $DESCRIPTION$ + * The attempt to modify a data member of a class was made. + * Only INLINE and METHOD can be modified + * $FUNCTION$ + * CLASSMOD + * $STATUS$ + * Harbour specific + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/3005 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Incorrect arguments type + * $DESCRIPTION$ + * Either the first argument was not an object or the second argument + * wasn't a string. + * $FUNCTION$ + * ISMESSAGE, OSEND + * $STATUS$ + * Harbour specific + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/3006 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of argument + * $DESCRIPTION$ + * The passed argument is of invalid type. This function expects a string + * with the name of file to open. + * $FUNCTION$ + * FOPEN + * $STATUS$ + * Harbour specific + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/3007 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of argument + * $DESCRIPTION$ + * The passed arguments are causing conflict in hanndling of the request. + * There is no point in waiting forever for no input events! + * $FUNCTION$ + * INKEY + * $STATUS$ + * Harbour specific + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/3008 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid type of argument + * $DESCRIPTION$ + * The passed argument(s) is not a string. It should be a string with + * a variable name or an one-dimensional array of strings. + * $FUNCTION$ + * __MVPRIVATE, __MVPUBLIC + * $STATUS$ + * Harbour specific + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/3009 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Incorrect type of argument + * $DESCRIPTION$ + * The second argument is not a numeric value. + * $FUNCTION$ + * LEFT + * $STATUS$ + * Harbour specific + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/3010 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to a function + * $DESCRIPTION$ + * The second arguments passed to a function is not a string. + * $FUNCTION$ + * STRTRAN + * $STATUS$ + * Harbour specific + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/3010 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to a function + * $DESCRIPTION$ + * The attempt to retrieve the function argument that was not passed. + * The number of requested argument is greated then the number of + * passed arguments. + * $FUNCTION$ + * PVALUE + * $STATUS$ + * Harbour specific + * $SEEALSO$ + * + * $END$ + */ + +/* $DOC$ + * $SUBCODE$ + * BASE/3012 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to a function + * $DESCRIPTION$ + * The first argument is not a string with function/procedure name + * that should be called. + * $FUNCTION$ + * DO + * $STATUS$ + * Harbour specific + * $SEEALSO$ + * + * $END$ + */ + + /* ************************************************************************** */ + +/* $DOC$ + * $SUBCODE$ + * TOOLS/4001 + * $CATEGORY$ + * arguments + * $ONELINER$ + * Invalid argument passed to function + * $DESCRIPTION$ + * The second arguments passed to a function is not a string. + * $FUNCTION$ + * ISLEAPYEAR + * $STATUS$ + * Harbour specific + * $SEEALSO$ + * + * $END$ + */ + +/* ************************************************************************** */ + +/* $DOC$ + * $SUBCODE$ + * TERM/2013 + * $CATEGORY$ + * files + * $ONELINER$ + * Create error + * $DESCRIPTION$ + * The specified file cannot be created due some OS error. + * $FUNCTION$ + * SET, SET ALTERNATE TO + * $STATUS$ + * Clipper + * $SEEALSO$ + * + * $END$ + */ diff --git a/harbour/include/errorapi.h b/harbour/include/errorapi.h index cc19aaabcb..74d58903d6 100644 --- a/harbour/include/errorapi.h +++ b/harbour/include/errorapi.h @@ -56,6 +56,7 @@ #define HB_ERR_SS_BASE "BASE" #define HB_ERR_SS_TERMINAL "TERM" #define HB_ERR_SS_DBCMD "DBCMD" +#define HB_ERR_SS_TOOLS "TOOLS" /* oError:GenCode */ @@ -100,6 +101,7 @@ PHB_ITEM hb_errPutFileName( PHB_ITEM pError, char * szFileName ); WORD hb_errorRT_BASE( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation ); WORD hb_errorRT_TERMINAL( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation ); WORD hb_errorRT_DBCMD( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation ); +WORD hb_errorRT_TOOLS( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation ); /* TODO: Enable this: void hb_errorInternal( ULONG ulCode ); */ diff --git a/harbour/include/hberrors.h b/harbour/include/hberrors.h index 36ae8b6e94..9a4dd5ea45 100644 --- a/harbour/include/hberrors.h +++ b/harbour/include/hberrors.h @@ -59,8 +59,8 @@ #define ERR_UNMATCHED_EXIT 18 #define ERR_SYNTAX2 19 #define ERR_INCOMPLETE_STMT 20 -/* JOSE */ #define ERR_CHECKING_ARGS 21 +#define ERR_INVALID_LVALUE 22 #define WARN_AMBIGUOUS_VAR 1 #define WARN_MEMVAR_ASSUMED 2 diff --git a/harbour/source/compiler/harbour.y b/harbour/source/compiler/harbour.y index 56e8e9cc7c..c1367666b9 100644 --- a/harbour/source/compiler/harbour.y +++ b/harbour/source/compiler/harbour.y @@ -290,7 +290,8 @@ char * _szCErrors[] = { "Statement not allowed outside of procedure or function" "%s statement with no loop in sight", "Syntax error: \'%s\' in: \'%s\'", "Incomplete statement: %s", - "Incorrect number of arguments: %s %s" + "Incorrect number of arguments: %s %s", + "Invalid lvalue" }; /* Table with parse warnings */ @@ -420,6 +421,11 @@ BOOL _bWarnings = FALSE; /* enable parse warnings */ BOOL _bAutoMemvarAssume = FALSE; /* holds if undeclared variables are automatically assumed MEMVAR */ BOOL _bForceMemvars = FALSE; /* holds if memvars are assumed when accesing undeclared variable */ +/* This variable is used to flag if variables have to be passed by reference + * - it is required in DO WITH statement + */ +BOOL _bForceByRefer = FALSE; + WORD _wSeqCounter = 0; WORD _wForCounter = 0; WORD _wIfCounter = 0; @@ -495,7 +501,7 @@ extern int _iState; /* current parser state (defined in harbour.l */ %type DOUBLE %type ArgList ElemList ExpList FunCall FunScope IncDec Logical Params ParamList %type INTEGER BlockExpList Argument IfBegin VarId VarList MethParams ObjFunCall -%type MethCall BlockList FieldList +%type MethCall BlockList FieldList DoArgList %type INTLONG WhileBegin BlockBegin %type IfElseIf Cases @@ -573,7 +579,8 @@ Statement : ExecFlow Crlf {} | VarAssign Crlf { GenPCode1( HB_P_POP ); } | IDENTIFIER '=' Expression Crlf { PopId( $1 ); } - | AliasExp '=' Expression Crlf { /* TODO */ GenPCode1( HB_P_POP ); } + | AliasVar '=' Expression Crlf { /* TODO */ GenPCode1( HB_P_POP ); } + | AliasFunc '=' Expression Crlf { --iLine; GenError( _szCErrors, 'E', ERR_INVALID_LVALUE, NULL, NULL ); } | VarId ArrayIndex '=' Expression Crlf { GenPCode1( HB_P_ARRAYPUT ); GenPCode1( HB_P_POP ); } | FunArrayCall '=' Expression Crlf { GenPCode1( HB_P_ARRAYPUT ); GenPCode1( HB_P_POP ); } | ObjectData '=' { MessageFix( SetData( $1 ) ); } Expression Crlf { Function( 1 ); GenPCode1( HB_P_POP ); } @@ -728,8 +735,11 @@ Macro : '&' Variable | '&' '(' Expression ')' ; -AliasExp : IDENTIFIER ALIAS IDENTIFIER {} +AliasVar : IDENTIFIER ALIAS IDENTIFIER {} | '(' Expression ')' ALIAS IDENTIFIER {} + ; + +AliasExp : AliasVar {} | AliasFunc {} ; @@ -816,9 +826,23 @@ VarAssign : IDENTIFIER INASSIGN Expression { PopId( $1 ); PushId( $1 ); } | ObjectMethod ArrayIndex DIVEQ { GenPCode1( HB_P_DUPLTWO ); GenPCode1( HB_P_ARRAYAT ); } Expression { GenPCode1( HB_P_DIVIDE ); GenPCode1( HB_P_ARRAYPUT ); } | ObjectMethod ArrayIndex EXPEQ { GenPCode1( HB_P_DUPLTWO ); GenPCode1( HB_P_ARRAYAT ); } Expression { GenPCode1( HB_P_POWER ); GenPCode1( HB_P_ARRAYPUT ); } | ObjectMethod ArrayIndex MODEQ { GenPCode1( HB_P_DUPLTWO ); GenPCode1( HB_P_ARRAYAT ); } Expression { GenPCode1( HB_P_MODULUS ); GenPCode1( HB_P_ARRAYPUT ); } - | AliasExp INASSIGN Expression {} + | AliasVar INASSIGN Expression {} + | AliasVar PLUSEQ Expression {} + | AliasVar MINUSEQ Expression {} + | AliasVar MULTEQ Expression {} + | AliasVar DIVEQ Expression {} + | AliasVar EXPEQ Expression {} + | AliasVar MODEQ Expression {} + | AliasFunc INASSIGN Expression { --iLine; GenError( _szCErrors, 'E', ERR_INVALID_LVALUE, NULL, NULL ); } + | AliasFunc PLUSEQ Expression { --iLine; GenError( _szCErrors, 'E', ERR_INVALID_LVALUE, NULL, NULL ); } + | AliasFunc MINUSEQ Expression { --iLine; GenError( _szCErrors, 'E', ERR_INVALID_LVALUE, NULL, NULL ); } + | AliasFunc MULTEQ Expression { --iLine; GenError( _szCErrors, 'E', ERR_INVALID_LVALUE, NULL, NULL ); } + | AliasFunc DIVEQ Expression { --iLine; GenError( _szCErrors, 'E', ERR_INVALID_LVALUE, NULL, NULL ); } + | AliasFunc EXPEQ Expression { --iLine; GenError( _szCErrors, 'E', ERR_INVALID_LVALUE, NULL, NULL ); } + | AliasFunc MODEQ Expression { --iLine; GenError( _szCErrors, 'E', ERR_INVALID_LVALUE, NULL, NULL ); } ; + Operators : Expression '=' Expression { GenPCode1( HB_P_EQUAL ); } /* compare */ | Expression '+' Expression { GenPCode1( HB_P_PLUS ); } | Expression '-' Expression { GenPCode1( HB_P_MINUS ); } @@ -1086,8 +1110,15 @@ RecoverUsing : RECOVER USING IDENTIFIER ; DoProc : DO IDENTIFIER { PushSymbol( $2, 1 ); PushNil(); Do( 0 ); } - | DO IDENTIFIER { PushSymbol( $2, 1 ); PushNil(); } WITH ArgList { Do( $5 ); } - | WHILE { PushSymbol( yy_strdup("WHILE"), 1 ); PushNil(); } WITH ArgList { Do( $4 ); } + | DO IDENTIFIER { PushSymbol( $2, 1 ); PushNil(); _bForceByRefer=TRUE; } WITH DoArgList { Do( $5 ); _bForceByRefer=FALSE; } + | WHILE { PushSymbol( yy_strdup("WHILE"), 1 ); PushNil(); _bForceByRefer=TRUE; } WITH DoArgList { Do( $4 ); _bForceByRefer=FALSE; } + ; + +DoArgList : ',' { PushNil(); PushNil(); $$ = 2; } + | Expression { $$ = 1; } + | DoArgList ',' { PushNil(); $$++; } + | DoArgList ',' Expression { $$++; } + | ',' { PushNil(); } Expression { $$ = 2; } ; Crlf : '\n' diff --git a/harbour/source/rtl/Makefile b/harbour/source/rtl/Makefile index 4732a4a098..10f0ff8512 100644 --- a/harbour/source/rtl/Makefile +++ b/harbour/source/rtl/Makefile @@ -13,6 +13,7 @@ C_SOURCES=\ dates.c \ descend.c \ dir.c \ + do.c \ environ.c \ errorapi.c \ extend.c \ diff --git a/harbour/source/rtl/classes.c b/harbour/source/rtl/classes.c index cc8ca9a6c4..5606ee85f3 100644 --- a/harbour/source/rtl/classes.c +++ b/harbour/source/rtl/classes.c @@ -482,7 +482,7 @@ HARBOUR HB_CLASSMOD(void) else if( ( pFunc == SetData ) || ( pFunc == GetData ) ) { /* Not allowed for DATA */ /*hb_errPutDescription(pError, "CLASSMOD: Cannot modify a DATA item");*/ - hb_errorRT_BASE(EG_ARG, 3001, NULL, "CLASSMOD"); + hb_errorRT_BASE(EG_ARG, 3004, NULL, "CLASSMOD"); } else /* Modify METHOD */ pClass->pMethods[ wAt ].pFunction = ( HARBOURFUNC ) hb_parnl( 3 ); @@ -831,7 +831,7 @@ HARBOUR HB_OCLONE( void ) } else { - hb_errorRT_BASE(EG_ARG, 3000, NULL, "OCLONE"); + hb_errorRT_BASE(EG_ARG, 3001, NULL, "OCLONE"); } } diff --git a/harbour/source/rtl/dates.c b/harbour/source/rtl/dates.c index cc137fd2f4..a74b51f703 100644 --- a/harbour/source/rtl/dates.c +++ b/harbour/source/rtl/dates.c @@ -428,7 +428,7 @@ HARBOUR HB_DTOS( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1120, NULL, "DTOS"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "DTOS"); } #endif } @@ -537,7 +537,7 @@ HARBOUR HB_TIME( void ) } else { - hb_errorRT_BASE(EG_ARGCOUNT, 9999, NULL, "TIME"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "TIME"); } } @@ -557,7 +557,7 @@ HARBOUR HB_DATE( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 9999, NULL, "DATE"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "DATE"); } } long hb_dow( long d, long m, long y ) @@ -630,7 +630,7 @@ HARBOUR HB_CMONTH( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1116, NULL, "CMONTH"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "CMONTH"); } } @@ -654,7 +654,7 @@ HARBOUR HB_CDOW( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1117, NULL, "CDOW"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "CDOW"); } } @@ -665,6 +665,6 @@ HARBOUR HB_SECONDS( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 9999, NULL, "SECONDS"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "SECONDS"); } } diff --git a/harbour/source/rtl/do.c b/harbour/source/rtl/do.c new file mode 100644 index 0000000000..d4f757c8ee --- /dev/null +++ b/harbour/source/rtl/do.c @@ -0,0 +1,84 @@ +/* + * $Id$ + Harbour Project source code + + This file is a part of Harbour Runtime Library and it contains code + that defined DO function ussed in DO WITH statement. + + Copyright (C) 1999 Ryszard Glab + www - http://www.harbour-project.org + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version, with one exception: + + The exception is that if you link the Harbour Runtime Library (HRL) + and/or the Harbour Virtual Machine (HVM) with other files to produce + an executable, this does not by itself cause the resulting executable + to be covered by the GNU General Public License. Your use of that + executable is in no way restricted on account of linking the HRL + and/or HVM code into it. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + 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/). + */ + +#include "extend.h" +#include "itemapi.h" +#include "errorapi.h" +#include "ctoharb.h" + +HARBOUR HB_DO( void ) +{ + PHB_ITEM pItem; + + pItem =hb_param( 1, IT_ANY ); + if( IS_STRING(pItem) ) + { + PDYNSYM pDynSym; + + pDynSym =hb_GetDynSym( pItem->item.asString.value ); + if( pDynSym ) + { + int i; + + PushSymbol( pDynSym->pSymbol ); + PushNil(); + for( i = 2; i <= hb_pcount(); i++ ) + Push( hb_param( i, IT_ANY ) ); + Do( hb_pcount() - 1 ); + } + else + hb_errorRT_BASE( EG_NOFUNC, 1001, NULL, pItem->item.asString.value ); + } + else if( IS_BLOCK(pItem) ) + { + int i; + + PushSymbol( &symEval ); + Push( pItem ); + for( i = 2; i <= hb_pcount(); i++ ) + Push( hb_param( i, IT_ANY ) ); + Do( hb_pcount() - 1 ); + } + else if( IS_SYMBOL(pItem) ) + { + int i; + + PushSymbol( pItem->item.asSymbol.value ); + PushNil(); + for( i = 2; i <= hb_pcount(); i++ ) + Push( hb_param( i, IT_ANY ) ); + Do( hb_pcount() - 1 ); + } + else + hb_errorRT_BASE( EG_ARG, 3012, NULL, "DO" ); +} diff --git a/harbour/source/rtl/errorapi.c b/harbour/source/rtl/errorapi.c index 6362e5c74c..6103a2ce76 100644 --- a/harbour/source/rtl/errorapi.c +++ b/harbour/source/rtl/errorapi.c @@ -335,3 +335,26 @@ WORD hb_errorRT_DBCMD( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, c return wRetVal; } + +WORD hb_errorRT_TOOLS( ULONG ulGenCode, ULONG ulSubCode, char * szDescription, char * szOperation ) +{ + PHB_ITEM pError = hb_errNew(); + WORD wRetVal; + + hb_errPutSeverity( pError, ES_ERROR ); + hb_errPutSubSystem( pError, HB_ERR_SS_BASE ); + hb_errPutGenCode( pError, ulGenCode ); + hb_errPutSubCode( pError, ulSubCode ); + if( szDescription ) + hb_errPutDescription( pError, szDescription ); + else + hb_errPutDescription( pError, hb_errorNatDescription(ulGenCode) ); + hb_errPutOperation( pError, szOperation ); + + wRetVal = hb_errLaunch( pError ); + + hb_errRelease( pError ); + + return wRetVal; +} + diff --git a/harbour/source/rtl/files.c b/harbour/source/rtl/files.c index 8809d911b3..1a86a51394 100644 --- a/harbour/source/rtl/files.c +++ b/harbour/source/rtl/files.c @@ -584,7 +584,7 @@ HARBOUR HB_FOPEN( void ) } else { - hb_errorRT_BASE(EG_ARG, 2021, "Argument error", "FOPEN"); + hb_errorRT_BASE(EG_ARG, 3006, NULL, "FOPEN"); } hb_retni(file_handle); diff --git a/harbour/source/rtl/inkey.c b/harbour/source/rtl/inkey.c index 7a0e433fdf..0908e896df 100644 --- a/harbour/source/rtl/inkey.c +++ b/harbour/source/rtl/inkey.c @@ -491,7 +491,7 @@ HARBOUR HB_INKEY( void ) if( wait && forever && ( s_eventmask & ( INKEY_ALL + INKEY_EXTENDED ) ) == 0 ) { /* There is no point in waiting forever for no input events! */ - hb_errorRT_BASE(EG_ARG, 9001, "Argument error", "INKEY"); + hb_errorRT_BASE(EG_ARG, 3007, NULL, "INKEY"); } else { diff --git a/harbour/source/rtl/math.c b/harbour/source/rtl/math.c index 6c46324660..80b65282cc 100644 --- a/harbour/source/rtl/math.c +++ b/harbour/source/rtl/math.c @@ -71,7 +71,7 @@ HARBOUR HB_ABS( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1089, NULL, "ABS"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "ABS"); } } @@ -95,7 +95,7 @@ HARBOUR HB_EXP( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1096, NULL, "EXP"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "EXP"); } } @@ -113,7 +113,7 @@ HARBOUR HB_INT( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1090, NULL, "INT"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "INT"); } } @@ -141,7 +141,7 @@ HARBOUR HB_LOG( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1095, NULL, "LOG"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "LOG"); } } @@ -174,7 +174,7 @@ HARBOUR HB_MAX( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1093, NULL, "MAX"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "MAX"); } } @@ -207,7 +207,7 @@ HARBOUR HB_MIN( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1092, NULL, "MIN"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "MIN"); } } @@ -289,7 +289,7 @@ HARBOUR HB_ROUND( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1094, NULL, "ROUND"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "ROUND"); } } @@ -321,7 +321,7 @@ HARBOUR HB_SQRT( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1097, NULL, "SQRT"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "SQRT"); } } diff --git a/harbour/source/rtl/memvars.c b/harbour/source/rtl/memvars.c index 04de373a45..52907cf614 100644 --- a/harbour/source/rtl/memvars.c +++ b/harbour/source/rtl/memvars.c @@ -444,7 +444,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, NULL, "&" ); + hb_errorRT_BASE( EG_ARG, 3008, NULL, "&" ); if( pDynVar ) hb_MemvarCreateFromDynSymbol( pDynVar, bScope, pValue ); @@ -518,7 +518,7 @@ void hb_MemvarRelease( HB_ITEM_PTR pMemvar ) } } else - hb_errorRT_BASE( EG_ARG, 3000, NULL, "RELEASE" ); + hb_errorRT_BASE( EG_ARG, 3008, NULL, "RELEASE" ); } diff --git a/harbour/source/rtl/strings.c b/harbour/source/rtl/strings.c index f20e2ba830..334be95b7d 100644 --- a/harbour/source/rtl/strings.c +++ b/harbour/source/rtl/strings.c @@ -272,7 +272,7 @@ HARBOUR HB_LTRIM( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1101, NULL, "LTRIM"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "LTRIM"); } } @@ -318,7 +318,7 @@ HARBOUR HB_RTRIM( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1100, NULL, "RTRIM"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "RTRIM"); } } @@ -341,7 +341,7 @@ HARBOUR HB_TRIM( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1100, NULL, "TRIM"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "TRIM"); } } @@ -591,7 +591,7 @@ HARBOUR HB_AT( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1108, NULL, "AT"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "AT"); } } @@ -650,7 +650,7 @@ HARBOUR HB_CHR( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1104, NULL, "CHR"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "CHR"); } } @@ -676,7 +676,7 @@ HARBOUR HB_ASC(void) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1107, NULL, "ASC"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "ASC"); } } @@ -705,7 +705,7 @@ HARBOUR HB_LEFT( void ) } else { - hb_errorRT_BASE(EG_ARG, 1124, NULL, "LEFT"); + hb_errorRT_BASE(EG_ARG, 3009, NULL, "LEFT"); } } else @@ -716,7 +716,7 @@ HARBOUR HB_LEFT( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1124, NULL, "LEFT"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "LEFT"); } } @@ -817,7 +817,7 @@ HARBOUR HB_SUBSTR( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1110, NULL, "SUBSTR"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "SUBSTR"); } } @@ -851,7 +851,7 @@ HARBOUR HB_LOWER( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1103, NULL, "LOWER"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "LOWER"); } } @@ -885,7 +885,7 @@ HARBOUR HB_UPPER( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1102, NULL, "UPPER"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "UPPER"); } } @@ -933,7 +933,7 @@ HARBOUR HB_REPLICATE( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1106, NULL, "REPLICATE"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "REPLICATE"); } } @@ -971,7 +971,7 @@ HARBOUR HB_SPACE( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1105, NULL, "SPACE"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "SPACE"); } } @@ -1163,7 +1163,7 @@ HARBOUR HB_STRTRAN( void ) hb_retclen(szText, pText->item.asString.length); } else - hb_errorRT_BASE(EG_ARG, 1126, NULL, "STRTRAN"); + hb_errorRT_BASE(EG_ARG, 3010, NULL, "STRTRAN"); } else hb_errorRT_BASE(EG_ARG, 1126, NULL, "STRTRAN"); @@ -1204,7 +1204,7 @@ HARBOUR HB_VAL( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1098, NULL, "VAL"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "VAL"); } } @@ -1356,6 +1356,6 @@ HARBOUR HB_STR( void ) else { /* QUESTION: Clipper catches this at compile time! */ - hb_errorRT_BASE(EG_ARGCOUNT, 1099, NULL, "STR"); + hb_errorRT_BASE(EG_ARGCOUNT, 3000, NULL, "STR"); } } diff --git a/harbour/source/tools/dates2.c b/harbour/source/tools/dates2.c index c806393a7a..7c34727dfd 100644 --- a/harbour/source/tools/dates2.c +++ b/harbour/source/tools/dates2.c @@ -175,7 +175,7 @@ HARBOUR HB_ISLEAPYEAR( void ) } else { - hb_errorRT_BASE(EG_ARG, 9999, NULL, "ISLEAPYEAR"); + hb_errorRT_TOOLS(EG_ARG, 4001, NULL, "ISLEAPYEAR"); } } diff --git a/harbour/source/tools/strfmt.c b/harbour/source/tools/strfmt.c index 65ab75c1f9..4beed98859 100644 --- a/harbour/source/tools/strfmt.c +++ b/harbour/source/tools/strfmt.c @@ -150,7 +150,7 @@ HARBOUR HB_STRFORMAT (void) /* StrFormat() */ nMaskPos = 0; - pszRetVal = pszRetValSave = hb_xgrab(nRetValLen + 1); + pszRetVal = pszRetValSave = (char *) hb_xgrab(nRetValLen + 1); while (nMaskPos < nMaskLen) { if (pszMask[nMaskPos] == '%') diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 57ca3a2883..ca72e48d4c 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -1456,7 +1456,7 @@ void Plus( void ) OperatorCall( pItem1, pItem2, "+" ); else - hb_errorRT_BASE( EG_DATATYPE, 1081, NULL, "+" ); + hb_errorRT_BASE( EG_ARG, 1081, NULL, "+" ); HB_DEBUG( "Plus\n" ); } @@ -2354,6 +2354,6 @@ HARBOUR HB_PVALUE(void) /* PValue( ) hb_itemReturn( pBase + 1 + wParam ); else { - hb_errorRT_BASE(EG_ARG, 9999, NULL, "PVALUE"); + hb_errorRT_BASE(EG_ARG, 3011, NULL, "PVALUE"); } } diff --git a/harbour/source/vm/initsymb.c b/harbour/source/vm/initsymb.c index 1b2ac1657e..2e89df0fe3 100644 --- a/harbour/source/vm/initsymb.c +++ b/harbour/source/vm/initsymb.c @@ -41,6 +41,7 @@ HARBOUR HB_CTOD( void ); HARBOUR HB_DATE( void ); HARBOUR HB_DAY( void ); HARBOUR HB_DEVPOS( void ); +HARBOUR HB_DO( void ); HARBOUR HB_DOW( void ); HARBOUR HB_DTOC( void ); HARBOUR HB_DTOS( void ); @@ -90,7 +91,7 @@ static SYMBOL symbols[] = { { "DAY" , FS_PUBLIC, HB_DAY , 0 }, { "DELETED" , FS_PUBLIC, NULL , 0 }, { "DEVPOS" , FS_PUBLIC, HB_DEVPOS , 0 }, - { "DO" , FS_PUBLIC, NULL , 0 }, + { "DO" , FS_PUBLIC, HB_DO , 0 }, { "DOW" , FS_PUBLIC, HB_DOW , 0 }, { "DTOC" , FS_PUBLIC, HB_DTOC , 0 }, { "DTOS" , FS_PUBLIC, HB_DTOS , 0 }, @@ -151,10 +152,10 @@ void InitSymbolTable( void ) * Place here your user defined __InitSymbols functions */ - - /* + + /* * The symbol tables from runtime support modules start here - */ + */ #ifdef HARBOUR_STRICT_ANSI_C #include "initsymb.h" #endif