MJNorris Posted July 30, 2018 Share Posted July 30, 2018 Hi there, I'm playing around with creating some custom VEX functions and came across something a bit odd that I just can't seem to get working. If I want to create a custom function that returns an array, say a vector array I will need to declare the return type at the beginning, according to the docs the following should work // A function which returns an array of vectors vector[] rgb_array() { ... }; However if I run this in a wrangle I get a syntax error on line1. Is this a bug? Or am I declaring my function type incorrectly? Thanks in advance m Quote Link to comment Share on other sites More sharing options...
MJNorris Posted July 30, 2018 Author Share Posted July 30, 2018 Okay, I actually got it working but those who have a similar issue I needed to use the 'funtion' function as the VEX compiler seems to be getting confused so .................... //doing an explicit function declaration seems to stop VEX getting muddled up function vector[] rgb_array() { return { {1, 0, 0}, {0, 1, 0}, {0, 0, 1} }; } 1 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.