Error in Array Index

This forum is for eXpress++ general support.
Post Reply
Message
Author
omni
Posts: 534
Joined: Thu Jan 28, 2010 9:34 am

Error in Array Index

#1 Post 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

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Error in Array Index

#2 Post 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.
The eXpress train is coming - and it has more cars.

messaoudlazhar
Posts: 42
Joined: Mon Dec 23, 2013 2:10 pm
Contact:

Re: Error in Array Index

#3 Post 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

omni
Posts: 534
Joined: Thu Jan 28, 2010 9:34 am

Re: Error in Array Index

#4 Post 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...

Post Reply