Passing back parameters from sub to calling script

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Massi
Newbie
Posts: 1
Joined: Fri Jan 10, 2020 9:05 pm

Passing back parameters from sub to calling script

Post by Massi » Fri Jan 10, 2020 9:52 pm

Hello,
I am a new user of MS since 3 weeks only and this is my first post to this forum.
I have already experimented quite a lot and already produced running EXE in this short time.
However, for sure, I have still a lot to learn about MS.

Variable localization nesting effect of it and parameter passing to a Sub are clear concepts for me.
I do not like utilization of global variables if not strictly necessary.
I have also understood that it is possible to write VBA code in MS to exploit functions and pass ByRef or return variables via functions in VBA style.

My Question:
Can you recommend me the best, efficient and elegant way to create a function like code in MS to return back parameters to the caller code without using global variables?
- Please to make me a simple example
- I would like to know also how to return back arrays and complex data.

Before starting to use intensively MS I would like to clarify this point.

Massimo

Post Reply