Idea

Cameron Pluim avatar image
2 Likes"
Cameron Pluim suggested Matthew Gillespie commented

Error being thrown when using Table

In one of my models I have code similar to the following:

Table myTable = reftable("GlobalTable1");
token.labels.assert("DelayTime").value = myTable[1][2];

and it throws the following error message:

Could not resolve correct operator for = operation. Left side is type Property, right type is TableElement

I'm able to get around it by setting a variable first like so:

Table myTable = reftable("GlobalTable1");
int DelayTime = myTable[1][2];
token.labels.assert("DelayTime").value = DelayTime;
tablesexceptions
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

@Cameron Pluim

I have moved the question from Idea space to the help space. If you think it should be at another place, could you ask the moderators to move the question again.

@Ben Wilson, @Paul Toone

Moving the post wasn't enough. The Idea is still an idea even if I moved it to the help space. Its character isn't changed. Please, could you try to repair my error. Thanks!

1 Like 1 ·
Matthew Gillespie avatar image
4 Likes"
Matthew Gillespie commented

This actually should be working. myTable[1][2] returns the value in the cell, not the cell. I'll add this to the dev list.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image
1 Like"
Joerg Vogel commented

Hello @Cameron Pluim the statement mytable[1][2] is the reference to the table cell. If you want to get access to the value of the cell you have to cast this reference to an integer or a double precise floating value.

token.labels.assert("DelayTime").value = myTable[1][2].as(double);
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Cameron Pluim avatar image Cameron Pluim commented ·

Thanks @Jörg Vogel. This makes sense to me

0 Likes 0 ·

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.