ikoon 159 Posted October 2, 2017 Please, in vex, is it possible to define a custom function, which will update the variable, without classic a = function(a) assignment? For example: f@big = 1.5; clamp01(f@big); // function clamps between 0 and 1 f@result = f@big; // result is 1.0 I found nothing, but I am newbie, sorry. Is this technique called "pass by reference", or also "pass a pointer"? Probably not possible in vex? Share this post Link to post Share on other sites
Nache 5 Posted October 2, 2017 (edited) I ikoon, sure you can, here's examples : vector pos = @P; void cl(vector pos) { pos.y = 0; } cl(@P); void clamp01(float cl) { cl = clamp(cl,0,1); } f@big = 1.5; clamp01(@big); // function clamps @big between 0 and 1 f@result = @big; // paste @big to @result Documentation about it Hope it help, Gab. Edited October 2, 2017 by Nache misspelled name 1 Share this post Link to post Share on other sites
ikoon 159 Posted October 2, 2017 Gabriel thank you very much! Share this post Link to post Share on other sites