functions to return 2 variables?
i'm trying to have a function return 2 values to 2 separate variables. i know the idea is for a function to only do 1 specific thing, and thats pretty much what my functions are doing. the only difference is, depending on user input, 1 of 2 different variables will be modified. SO, at the end of this function, i have it return 2 variables - 1 has been modified, 1 is the same as when the function began.
i COULD go back and make 2 functions, which may be what i have to do, but it'd be really convenient if there was a way to be able to return multiple variables.
this is what i have tried thus far - this is similar to the format in other programming languages (mainly math-oriented ones) so i thought it might work, but no luck:
[int, int] functionname(variable1, variable2, variable3)
then, in the main program, to call it, i put:
[mainvariable1, mainvariable2]=functionname(variable1, variable2, variable3);
and within the function i put:
hoping that would do the trick to return 2 variables. it didn't.