06-19-2007, 12:28 AM
Hi,
I am trying to simplify my scripts by putting an often repeated step in a function
say
When GetDemographics is run in the main macro script (Let's call it "mainscript"), it should call up the code in GetDemographics which will find out values for str variables a, b, c, d and e by running the script in GetDemographics.
I would like these values to be passed back to the caller script ("mainscript").
For simplicity's sake let just say
that GetDemographics code would be:
Now, after GetDemographics is completed running, mainscript should have values for a, b, c, d, e as determined above in GetDemographics.
It seems like I should be able to do this easily but I am getting confused with variable scope (str+) i.e. do I have to define the variables locally in both caller and GetDemographcis? Do I need to define receiver variables in first line of function? Just can't seem to get it to work.
Thanks for any help....
Stuart
I am trying to simplify my scripts by putting an often repeated step in a function
say
When GetDemographics is run in the main macro script (Let's call it "mainscript"), it should call up the code in GetDemographics which will find out values for str variables a, b, c, d and e by running the script in GetDemographics.
I would like these values to be passed back to the caller script ("mainscript").
For simplicity's sake let just say
that GetDemographics code would be:
Now, after GetDemographics is completed running, mainscript should have values for a, b, c, d, e as determined above in GetDemographics.
It seems like I should be able to do this easily but I am getting confused with variable scope (str+) i.e. do I have to define the variables locally in both caller and GetDemographcis? Do I need to define receiver variables in first line of function? Just can't seem to get it to work.
Thanks for any help....
Stuart