Page 1 of 1

Error in Array Index

Posted: Fri May 27, 2016 7:30 am
by omni
Roger,

Just trying to clarify an error pasted below. Happens once in every 100-200 times at this site .Hard to verify since the users are only in one menu option and it works 'most' of the time.

oError:args :
-> VALTYPE: A VALUE: {{588.000, "F", 30000, 155, 1, 588.000, " ", 0}}
-> VALTYPE: N VALUE: 2
oError:description : Error in array index
oError:filename :
oError:genCode : 4
oError:operation : <A of 1>[<2>]
CALLSTACK:
Called from AUTORATE(2984)

The line in autorate is:

DO WHILE Z<=X
***LOOK FOR SPECIAL ACCESSORIAL CHARGES***
IF RATES[Z,7]="Y" .and. rates[z,6]<>0 ///error line

***********************************************

Appears to mean that the array is only 1 and that z=2. That would mean x is more than the array. They retry and it works. Driving a crazy guy crazier.

Just want to verify I am reading it right.

Thanks and have a good holiday weekend.

Fred
Omni

Re: Error in Array Index

Posted: Fri May 27, 2016 8:12 am
by rdonnay
I would need to see more of your code to advise you.

You are correct in your analysis that the value of Z is greater than the Length of the array RATES.

Your loop should take this into consideration.

I'm not sure why a retry works, unless there is another thread that is pushing data into the array RATES.

I am assuming that X is stored with a value equal to the length of the array RATES but your code doesn't show me enough.

Re: Error in Array Index

Posted: Fri May 27, 2016 9:38 am
by messaoudlazhar
Hi,
-> VALTYPE: A VALUE: {{588.000, "F", 30000, 155, 1, 588.000, " ", 0}}
-> VALTYPE: N VALUE: 2

Your multi-dimension table contains only one element and 8 sub-elements
to select an item you need two arguments (x, y)

in this case give an argument
Nametable[1,1..8]

Example :

Nametable[1,4] => 155

Messaoud Mohamed Lazhar

Re: Error in Array Index

Posted: Fri May 27, 2016 1:01 pm
by omni
The calls to autorate (the program) are all from one other program but the error is occurring when called in another location, in a child window..and it called only under one event, which is occasional. There must be something happening with 'x' from this child window. never gives this error from any other call. Very odd, still, that it occurs only 2 or 3 % of the time or less. Duplicating has not been possible in testing, so that is why I asked to verify the reasoning for the error.

Thanks, I will figure it out eventually...