B4J Question IDE Message: Index was out of range

Didier9

Well-Known Member
Licensed User
Longtime User
I am getting this when I click on a variable name (actually an array) and ask for Find All References:
[IDE message - 9:10:51]
An error occurred.
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
This occurs even if I close and reopen the project after having cleaned the meta file, before executing.
I just open the project, navigate to the section of code, right-click on the variable and click on Find All References.
This started after I had a legitimate error in my code where I would try to read an array element past the last value.

As an experiment, I copied just the b4j and bas files, and the Files folder into a new folder and tried to run the IDE from there and I get the same issue.
How could it complain about an out of range index even before executing code? This sounds too much like magic :)

More info: I did have variables named Index, so I renamed them all. The error message remains the same, so "index" does not refer to one of my variables.

Note: the program does run and I can lookup other variables, I just can't use the Find All References feature on THAT variable.
 
Last edited:

LucaMs

Expert
Licensed User
Longtime User
I had weird problems probably related to this same thing trying to rename a variable automatically. In my case it was enough to "clean up the project" (CTRL + P).

More info: I did have variables named Index, so I renamed them all. The error message remains the same, so "index" does not refer to one of my variables.
In fact I believe it refers to an internal IDE variable.


right-click on the variable and click on Find All References.
Press F7 "on the variable" :)
 
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
I agree, definitely sounds like an internal IDE issue. I revised the thread title.

CTRL + P did not fix it and F7 "on the variable" returned the same thing :(

But thanks for the pointers to those shortcuts, I was not using them :)

At least everything else seems to be running, so it's just an inconvenience at this point. Weird tho.
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Note: the program does run and I can lookup other variables, I just can't use the Find All References feature on THAT variable.
I've fixed such bug a few days ago. It happens with a global variable that was redimmed.
It will be included in the next versions of the IDE.
 
Upvote 0
Top