list of list of integers (VEX)

   2202   5   0
User Avatar
Member
196 posts
Joined: Aug. 2011
Offline
Hi all,


I've been trying this now for two hours without success.

I'd like to create “list of lists of integers” in VEX. I need to access each pair again later on by index.

In python:
mylist = [, , ]
mylist –>

I cannot figure out how to create the elements, as int, vector2, array().

Any help would be appreciated. Thank you!
m.
User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
disclaimer: NOT a VEX expert, just reading the help,

Note

Currently VEX does not support multi-dimensional arrays.

so maybe that's why ?

it works for vector as in:

vector mylist[] = { {1,0,0}, {0,1,0}, {1,1,0} };

so maybe do this and ignore the last component ?

last word, dunno.
User Avatar
Member
555 posts
Joined: Feb. 2017
Offline
hmm…this seems to work:

vector mylist[] = array( {0,0}, {1,0}, {0,1}, {1,1} );

I still don't know $4it tho.
User Avatar
Member
7747 posts
Joined: Sept. 2011
Offline
Can you store it as a flat integer array, and an array of offsets?
User Avatar
Member
196 posts
Joined: Aug. 2011
Offline
Hi,

thanks for the inputs, much appreciated.

VEX not yet supporting multi-dimensional arrays is one of those key points, I missed this information…

Well I can use vectors as a hack and then cast the 3 floats to int, I just was searching for a ‘native’ solution.

Thanks again, I believe this should work!
m.
User Avatar
Member
8535 posts
Joined: July 2007
Offline
I'd go for flat integer array too, rather than array of vectors that you need to convert
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links