You could pass the variables you want the function to write to by reference. (Change the function to a sub).
for example
Sub Add(a as single, b as single, ByRef c as single, ByRef d as single) ...
Just wanted to point out, arguments are passed by reference
by default in VB. You only need to specify if you want to pass them by
value. In other words, while you might sometimes code the
ByVal keyword, there is really no need for
ByRef.
As an example, these two definitions produce the same result...
- Sub Add(a As Single, b As Single, c As Single, d As Single)
-
Sub Add(a As Single, b As Single, ByRef c As Single, ByRef d As Single)