Error in Array Index

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

Error in Array Index

#1 Post by omni »

Roger,

We have been using a program for years that uses a 9-dim array and has had no problems. Normally only 20-30 items will be added and cleared. This is for users to clear open items in a very large file, and able to select those items to flag.
One user recently has had the need to flag 300-600 items and eventually (almost always) gets an Error in index array, and the line number is the gui read, so we get no real help on that. But we have seen other errors when selecting that also had the error, and it gives the error 326/325, or similar. Like it loses count of the array size.
Is there a limit or memory issue when there are that many memory vars in an array. (ie, 325*9), or could it be she is selecting too fast?
I may have to change it to a work file instead if I cannot fix it for these large ones.

Just some basics here..
if they delete one by double clicking one that was selected:

ADel(aRecords[1],nFound)
ASize(aRecords[1],Len(aRecords[1])-1)

if they select one:

AAdd(aRecords[1],opentkts->ticket)

(must have hit a wrong key)

if they cancel out

ADel(aRecords[1],nFound)
ASize(aRecords[1],Len(aRecords[1])-1)

So AAdd changes ASize automatically.

We use this in many programs, but not that many records.

Fred
Omni

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

Re: Error in Array Index

#2 Post by rdonnay »

Is there a limit or memory issue when there are that many memory vars in an array. (ie, 325*9), or could it be she is selecting too fast?
There is no limit. I have worked with arrays much larger.

I would need to see more code.
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,
1/ you can change the following lines:

ADel(aRecords[1],nFound)
ASize(aRecords[1],Len(aRecords[1])-1)

by

Aremove(aRecords[1],nFound)

2/ Probably talk about size exceeded and not size problem (ex: the selected element 326 on a size of 325)
may be must be tested to check the size and locate the problem

Messaoud Mohamed Lazhar

Post Reply