Functions typically return single values, for example:
Private Function iGetResult(iInput as Integer) As Integer
...
...
will take an integer, do something, then return an integer back to whatever called it.
Instead of returning a single value, is it possible to define a function such that it will return an array of values? To illustrate what I mean:
Private Function iGetResult(strWord as String) As ???
to take a string such as strWord="cat", and then
return an array of letters:
iGetResult(0)="c"
iGetResult(1)="a"
iGetResult(2)="t"
Array variable are typically defined with parathesis, but functions use the parenthesis to define fucntion inputs, so I'm not sure if its doable, or what the syntax would be if it was.
Is there a way to do the above at all using a single function? I suppose could just store the array data in a global public variable to read outside the function, but I was wondering if there's a more elegant way to do it.
Thanks in advance.
Private Function iGetResult(iInput as Integer) As Integer
...
...
will take an integer, do something, then return an integer back to whatever called it.
Instead of returning a single value, is it possible to define a function such that it will return an array of values? To illustrate what I mean:
Private Function iGetResult(strWord as String) As ???
to take a string such as strWord="cat", and then
return an array of letters:
iGetResult(0)="c"
iGetResult(1)="a"
iGetResult(2)="t"
Array variable are typically defined with parathesis, but functions use the parenthesis to define fucntion inputs, so I'm not sure if its doable, or what the syntax would be if it was.
Is there a way to do the above at all using a single function? I suppose could just store the array data in a global public variable to read outside the function, but I was wondering if there's a more elegant way to do it.
Thanks in advance.