Home AMX User Forum NetLinx Studio

Error Message

TurnipTruckTurnipTruck Junior MemberPosts: 1,485
974: 01-16-2007 TUE 17:11:22 Interpreter Ref Error ? Index to large
975: 01-16-2007 TUE 17:11:09 Interpreter Ref Error ? Index to large

Any idea where to start with this?

Comments

  • matt95gsrmatt95gsr Junior Member Posts: 164
    A good place to start would be for AMX to repair the message to read "too large". :) I think that somewhere you're probably trying to reference an element that doesn't exist in an array. Like trying to pull a value from (or assign a value to) nMyVar[5] when the variable was declared as having only 4 elements... INTEGER nMyVar[3]. The problem is that you're not given any indication as to where in the code it's happening so you have to search through every array that is referenced. I've seen that happen more commonly in feedback statements that have been copy/pasted and in FOR loops more commonly than anywhere else as I can remember.
  • Spire_JeffSpire_Jeff Formerly Caffeinated Programmer Posts: 1,917
    My initial thought would be to check were you are referencing arrays with varibles. Something like:
     FOR(nCOUNTER = 1;nCOUNTER<10;nCOUNTER++)
        SEND_COMMAND dvTP,"'!T',nBUTTON_ARRAY[nCOUNTER],'UPDATING'"
    
    

    Make sure that there is no chance that nCOUNTER can be higher than LENGTH_ARRAY(nBUTTON_ARRAY).

    You can start monitoring communication to other devices and see when the error occurs and then start inserting temporary send_string 0,"VARIABLE INFO'" commands to narrow down the cause (if it's not obvious).

    I had similar problems with index values being 0 because I forgot to initialize variables :)

    Jeff
  • alexanboalexanbo Junior Member Posts: 282
    I'd try compiling with debug info turned on so that it would tell you what line number the error was occuring on. Of course if you use a lot of include files or modules you'd then have to figure out which of them the error comes from.
  • TurnipTruckTurnipTruck Junior Member Posts: 1,485
    alexanbo wrote:
    I'd try compiling with debug info turned on so that it would tell you what line number the error was occuring on.

    Could you explain that process more closely? The only debugging I've used is variable watching.
  • DHawthorneDHawthorne Old Timer Posts: 4,584
    Could you explain that process more closely? The only debugging I've used is variable watching.

    In compiler options, there is a "Compile with debug info" check box. I leave it on all the time ... theoretically, your compiled code is going to run more efficiently without, but in practical terms, I haven't seen a difference since Axcent days, the processors are fast enough to make it come to nothing. Code size is smaller though, so if you are really tight for memory (again, not real likely these days) you can turn it off once the kinks are worked out.

    However, there are still times, even with the debug data there, that line numbers are not present on error messages, or flat out wrong. It's a good place to start though.
  • TurnipTruckTurnipTruck Junior Member Posts: 1,485
    After compiling with debug, where will I view any information gathered?
  • alexanboalexanbo Junior Member Posts: 282
    It will show up in the Diagnostics tab and will just append the line number to the end of the error message

    974: 01-16-2007 TUE 17:11:22 Interpreter Ref Error ? Index to large Line XXX
Sign In or Register to comment.