renderfan Posted November 1, 2015 Share Posted November 1, 2015 I do calculation on arrays in VEX. It is no problem to write function to return one array but how can I return another array? In python this is easy but I do not know how is possible in VEX.Thanks in advance! Quote Link to comment Share on other sites More sharing options...
f1480187 Posted November 1, 2015 Share Posted November 1, 2015 Use routine-style. For some reason, we cannot define functions returning arrays in Wrangle/Snippet nodes (more generally, array functions defined inside other functions), and we have to use this style for setting single array too. Example for Point Wrangle: void two_arrays(float a1[]; vector a2[]) { a1 = array(1, 2, 3); a2 = array({1,2,3}, {4,5,6}, {7,8,9}); } two_arrays(f[]@array_one, v[]@array_two); BTW this called side effects. 1 Quote Link to comment Share on other sites More sharing options...
renderfan Posted November 1, 2015 Author Share Posted November 1, 2015 Thank you very much! I will try do it this way. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.