LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

GetTableCellRangeVals - The index passed is out of range

I  have to enter a set of numbers into a variable matrix array. So I began to design a table with variable columns and rows. Then the data inputet in the table has to be stored into  an array.

 

I read the cell values with GetTableCellRangeVals, but then i get this error : "NON-FATAL RUN-TIME ERROR:   line 105, col 21, thread id 0x00000948:   Library function error (return value == -55 [0xffffffc9]). The index passed is out of range"

 

This is part of the program: 

 

static char *matrice_valori[100];

.....................................................................................

 

GetTableCellRangeVals (panelHandle, PANEL_TABLE, MakeRect(1,1,n,n), matrice_valori, VAL_COLUMN_MAJOR);

 

What am I doing wrong,  and is there another easyer way to gat the numbers, from the table into my array?

0 Kudos
Message 1 of 4
(3,760 Views)

The easy answer is that 'n' has a wrong value: either NaN or a negative value. Place a breakpoint on that line and examine its value.

Or you may be passing a range that is outside the table size.

 

A more complex situation is when you are passing a wrong panel handle with the effect of addressing a control in a panel different from the one you are expecting. This scenario is very common if your table is on a tab controland you are passing the handle of the panel that holdsthe tab control instead of that of the tab page. If this is your case use GetPanelHandleFromTabPage to retrieve the correct panel handle which yiu can use to address all controls on the page of the tab control.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 4
(3,750 Views)

Hi cat87,

 

my suspicion is that n is too large (or negative)... probably too large by one...

 

so may be you could check the n values you use.

 

....ok, Roberto was faster and more elaborate 🙂

Message Edited by Wolfgang on 06-10-2010 04:35 PM
Message 3 of 4
(3,748 Views)
Turns out that the probleme was indeed that "n".  In a line of my programe i wrote  n=col_number, but n wasn't initiated at the begining. So i got that error, which made the line of code    "MakeRect(1,1,0,0)". Thanks for your input.

Message 4 of 4
(3,740 Views)