That changes things. If you need to pass values back and forth, you
either have to work with FUNCTIONs and not SUBs (FUNCTIONS execute code
and return the values you designate, SUB simply execute code).
Necause there are often multiple ways to do things, instead
of asking us to explain how to do a half explained
operation, please tell us more about what you are trying to
accomoplish so the answer can be tailored to your problem.
That changes things. If you need to pass values back and forth, you
either have to work with FUNCTIONs and not SUBs (FUNCTIONS execute code
and return the values you designate, SUB simply execute code).
Yes executing code ALWAYS has an effect. Its up to the developer to
determine when/how to execute code. My answer was geared toward the
question of passing values between SUBs. Granted, I did omit
module-level variables and globals.
The point I was trying to make is that passing values between Sub
procedures is trivially easy: you just pass arguments by reference and
modify them as required.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.