Page 1 of 2
Error: Parameter has a wrong data type
Posted: Thu Nov 05, 2020 12:52 am
by skiman
Hi,
I see this kind of error very regulary. I don't understand it. In the args you can see that there are two numeric values. In the operation there is val > val and it gives the error.
The line where the error appears is a simple:
If nSales > 0
oError:args :
-> VALTYPE: N VALUE: 0
-> VALTYPE: N VALUE: 0
oError:canDefault : N
oError:canRetry : N
oError:canSubstitute: Y
oError:cargo : NIL
oError:description : Parameter has a wrong data type
oError:filename :
oError:genCode : 2
oError:operation : <0> > <0>
oError:osCode : 0
oError:severity : 2
oError:subCode : 3
oError:subSystem : BASE
oError:thread : 4
oError:tries : 0
Could this be a memory problem or something?
Re: Error: Parameter has a wrong data type
Posted: Thu Nov 05, 2020 2:43 am
by reganc
For what it's worth, I have seen hundreds of these types of error (along with persistent db* errors which I still have no clue how to resolve).
I asked Alaska about this error at one point and they could not give me a straight answer.
The problem is always one of not being able to replicate it on demand. If we could replicate it, Alaska might have a chance to fix it. I presume that you haven't been able to replicate it?
If there is already a fix and I haven't noticed, I'm going to be most upset... :-)
Re: Error: Parameter has a wrong data type
Posted: Thu Nov 05, 2020 5:04 am
by Koverhage
I have this error only (1.99.355) with
division with 0
or
the result is too large 0.000000000000000000000000000000000000000000000000000
Re: Error: Parameter has a wrong data type
Posted: Thu Nov 05, 2020 9:57 am
by rdonnay
You can trap this kind of error in the error handler if you can see some consistent error information.
Do you have a history in your xpperror.log file?
Re: Error: Parameter has a wrong data type
Posted: Thu Nov 05, 2020 10:10 am
by reganc
rdonnay wrote: ↑Thu Nov 05, 2020 9:57 am
You can trap this kind of error in the error handler if you can see some consistent error information.
Do you have a history in your xpperror.log file?
Hi Roger
I'm sure it's easy enough to trap. But what would you do then?
Ignore it and allow the program to continue?
I receive emails of all errors our customers have (provided the auto-emailing function in our application can sent them).
Re: Error: Parameter has a wrong data type
Posted: Thu Nov 05, 2020 10:25 am
by skiman
Hi,
I have an errorlog which is send to me when an error occurs at a customer site.
As Regan said, there are two kind of errors:
- db-errors, which are always solved after reindexing. These are sometimes reproducable, and disappear after a re-index.
- Parameter has a wrong data type which doesn't make any sense in most of the cases. Sometimes a var is already evaluated with no problems some lines before, and suddenly in a next evaluation the error is generated. The solution I sometimes add in the code is
if valtype(nVar)=="N".and. nVar>0 but this is not a solution.
Anyway, thank's for the responses. Looks as I'm not the only one with this problem, which is comforting me.

Re: Error: Parameter has a wrong data type
Posted: Thu Nov 05, 2020 10:41 am
by Auge_Ohr
hi,
Index Error of DB most are based on DBESYS
show us your DBESYS
Re: Error: Parameter has a wrong data type
Posted: Thu Nov 05, 2020 10:43 am
by reganc
I was curious about the history of this occurring, so I checked my error logs.
And although I did receive a large number of these errors...
I hadn't realised that I hadn't received an error log like this since Jun 2018.
So my memory has failed me here. I don't quite understand what changed unless it was an update of some kind.
Chris, out of interest, what Xbase++ version are the errors from?
Re: Error: Parameter has a wrong data type
Posted: Thu Nov 05, 2020 11:50 am
by rdonnay
I'm sure it's easy enough to trap. But what would you do then?
Ignore it and allow the program to continue?
Yes, I have written error handlers that trap divide by zero errors.
The line of code that errors would be simply ignored.
CASE oError:genCode == XPP_ERR_ZERODIV
RETURN 0
Re: Error: Parameter has a wrong data type
Posted: Fri Nov 06, 2020 1:09 am
by skiman
Hi Regan,
I'm still using 1.9.355.