LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

SetTableCellRangeVals Error

i am trying to use the sample code:

 

int i;
int ReportArray[14];
for (i=0; i<14; i++){
ReportArray[i] = i;
}
InsertTableRows (reportpanel, ReportTableCtrl, -1, 1, VAL_CELL_NUMERIC);
InsertTableColumns (reportpanel, ReportTableCtrl, 1, 13, VAL_CELL_NUMERIC);
SetTableCellRangeVals (reportpanel, ReportTableCtrl, VAL_TABLE_ENTIRE_RANGE, ReportArray, VAL_ROW_MAJOR);

 

But there is an error message when running the code:

FATAL RUN-TIME ERROR: "Main.c", line 356, col 82, thread id 0x0000DD8C: Invalid argument type: found 'pointer to int', expected 'pointer to double'.

in addition, how do I change the Tablecell attribute to be unsigned data or int data?

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

The error is quite clear: you are passing an int data variable where a double one is required; calling SetTableCellRangeAttribute with attribute ATTR_DATA_TYPE and value VAL_UNSIGNED_INTEGER or the type of data you need fixes the situation.

 

In general, for every control on the user interface you can right-click on it and select Control Help to dispaly the help page for the control (here the one for the table control); in that page you can select Table Control Attributes to get to a list of all valid attributes for that control, which you can set with the appropriate setting control.

 

Consider also that if you have set the table control while designing the panel in the UIR editor, you can set all characteristics of cellr and ranges in the control properties panel shown double-clicking on it.



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?
0 Kudos
Message 2 of 3
(4,109 Views)

Hi RobertoBozzole,

                    

I see, thank you so much for the help.

 

 

0 Kudos
Message 3 of 3
(4,021 Views)