Returning Values via References

Let the caller determine how to return the function result and avoid the need of dedicated variables.

Description: Instead of using "global" variables for return value, the function can use one of it`s arguments as variable reference. The caller can then pass a variable name to the function and the function can store the result into this variable making use of the command line expansion of the command processor:

Note: The var1 variable is not reserved for this articular function. Any variable can be passed to the function the caller has full control.
Usage:
1.
2.
call:myGetFunc var1
echo.var1 after : %var1%
Script:
1.
2.
3.
:myGetFunc    - passing a variable by reference
set "%~1=DosTips"
goto:eof
Script Output:
 DOS Script Output
var1 after : DosTips