You have at least 1+ ways:
1. Use 'byRef' keyword for the function parameter and write data in it. As i remember parameters ARE given byRef by default so you can return data in using function parameters
1+. Create a structure and use it!
function myFunc (inout as myStruct) as integer
here integer may have function result (1 / 0 = success / fail) and myStruct - all the input and output parameters.
I am using one of the Optional variables to pass a value to the function from my subprocedure and another optional variable to pass the result of the function back to the sub procedure. I could have done this with the function name, but then I would only be limited to one variable, by using the variables in the function statement, I can add as many as I need, and can pass them both in and out of the function.
The code follows (copy and paste in Robot):
'Function to collect the IE Temp Directory location from a System Environment Variable
Function GetIETempFile(Optional gInTmpFile, Optional gOutTmpFile) As Integer
Dim Position(5) As Integer
Dim strText As String
'Collects the number of spaces to the Cookie directory and the number of spaces