Jump to content
kev2

VEXing array question - SOLVED

Recommended Posts

Hi, 

If I use an attribute wrangle to create an array attribute and populate the array like so:

i[]@stuff = nearpoints (0, @ape, 1, 23);

I can then slice the array like so:

i@branch = @stuff[3];

and all is good in the world.

However, if I attach another wrangle node and try to use the same slice, I get an error even though the array attribute shows up in the spreadsheet? 

Not a showstopper but I'd love to know why the attribute isn't accessible.

Edited by kev2

Share this post


Link to post
Share on other sites

I don't know why that doesn't work, but this seems to work:

i@the_slice = i[]@opinput0_stuff[3];

-b

  • Like 1

Share this post


Link to post
Share on other sites

Oh, nice trick Bonsak. Works for me too. I'll give this post a couple days and submit it to support if no one can explain it. Maybe its not supposed to for some reason.

 

Share this post


Link to post
Share on other sites

And,

i@the-slice = i[]@stuff[3]; 

also works so it appears to need the [] prefix for the vex snippet to pick up an array attribute. 

 

Share this post


Link to post
Share on other sites

For completeness, all I needed to do was declare the array as itself: 

i[]@stuff = i[]stuff; 

and then it picks up the array so that i@branch = @stuff[4] works fine now. Thanks @david for the assist. 

 

 

Edited by kev2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×