View Full Version : Is it possible to return multiple values from a function?
thewebchat
4th October 2009, 17:26
For example, using the AVS language, would it be possible to write a function that takes in as input one integer and returns its reduced factors? The only thing I can think of is to use some kind of recursion hack and return a string.
Gavino
4th October 2009, 19:22
It's not possible to do this directly in the language, so you have to resort to some sort of trick. Returning a string of some kind is about the best you can do. However, if the number of outputs is fixed and each value is limited (say to 255), you could construct a binary integer, eg output1 + output2*256 + output3*(256^2).
Myrsloik
6th October 2009, 00:27
Assign the results to global variables?
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.