table display via lookup

Recommended Posts


I have a table displaying selected contents of a 3d array (table_array). It's all numerical and if possible id like not to modify this array, just display it.

For one of the table columns, i would like the table to take the numerical value, say 0,1,2..  and display text from a look-up string array corresponding to those integers. Forother columns just display the numerical value as it is.

I initially thought just expression:  lookup_array[table_array[]]   but this obviously only displays one value in the table, i need to display all the rows of table_array but substituting the numerical value of each row for that column, with a string from the lookup array.

Any ideas? Cheers

Link to comment
Share on other sites

Then just create a little sequence that runs at low priority that fills a string array.  Something like:

global string labels

for (private i = 0, i < numrows(table_array), i++)
   labels = lookup_array[table_array]

Run it at priority 0 whenever you want to update and have the actual table display use the labels variable for that column.

Link to comment
Share on other sites

Yeah, I was hoping there might be a more elegant way to 'convert' the value dynamically with some fancy syntax in the expression because the table switches between displaying multiple depths of the array. I can make a separate 3d string array for display I suppose, it can just be generated when the array changes as it changes with a function call


Link to comment
Share on other sites

No, because you are asking it to subset an array based on an array of indices.  It would work fine for a single element, but not an array of elements.  I don't know your app, but I would consider just maintaining another string array parallel to the index array that is automatically updated whenever the index element changes.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.