Cannot write value to table - Given row \'n\' does not exist

Discussion about recent product features & solutions!
4 posts • Page 1 of 1
Smiffy
Posts:45
Joined: Thu May 18, 2017 4:21 pm

Cannot write value to table - Given row \'n\' does not exist

Post by Smiffy »

I have a table called "MsgList" defined in a panel that has 6 columns and 10 rows.
The columns are named "Number", "Type", "Config", "Entry Time", "Exit Time" and "Ack Time".
The rows are named "#1","#2","#3","#4","#5","#6","#7","#8","#9" and "#10".
The table object has the Initliise script below (whicj I got from the help files).
main()
{
shape MsgList = getShape("MsgList");
dyn_string pMsgList;

pMsgList[1]="111";
pMsgList[2]="white";
pMsgList[3]="black";
MsgList.cellValueRC(0, "Number", pMsgList);
}

For some reason that I cannot figure, this does not work. I get the following warning in the log file and no value appears in the table.
58/uim, MsgList.cellValueRC (TABLE), Given row '0' does not exist

I have tried other row references in place of the 0 such as 1,2,3 etc. This still does not work as it says that row '1','2','3' etc. do not exist.
I have also tried using the table reference by replacing the 0 in the cellValueRC call with '#1','#2','#3' but that didn't work either.

Any ideas as I am stuck?
The help text does hint about having to use a setValue call before using the cellValueRC call, but rather unhelpfully does not show this in the example.

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Cannot write value to table - Given row \'n\' does not exist

Post by mkoller »

Whatever you define in Gedi for the rows, initially the table is still empty in Vision, so you first have to add a row.
Try e.g. MsgList.appendLines(10); to append 10 empty lines (or use any other function to add a row).

Smiffy
Posts:45
Joined: Thu May 18, 2017 4:21 pm

Re: Cannot write value to table - Given row \'n\' does not exist

Post by Smiffy »

Martin

That works. Thank you immensley. You are a "steely-eyed missile man". Top work sir.

Steely-eyed missile man

Dave.

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Cannot write value to table - Given row \'n\' does not exist

Post by mkoller »

Always wanted to be an astronaut :-)

Thanks

4 posts • Page 1 of 1