variables in subscripts

Holger Mahlke bh89 at IMK.UNI-KARLSRUHE.DE
Fri Dec 18 08:23:06 EST 2009


Dear all,

I have a question concering defining variables in subscripts. I have a 
main script and there the subscript stations.gs is called this way:
 	...
 	'run stations.gs'
 	...
in the subscript stations.gs I define a list of variable this way:
 	...
 	station.1='Stuttgart'
 	station.2='Karlsruhe'
 	...
Now, how can I use the defined values of the variable station.x in the 
main script after calling the sub script?
I tried to call it like
 	'run stations.gs'
 	say station.2
but it does not work.
I tried to define the variables as global variables but it does not work 
either. It seems that the variable is only known within the subscript.
Does anybody have an idea how I can solve the problem? The list of 
station names is very long that's why I want to define them in the 
subscript, not in the main script. Thanks in advance.
Best regards,
Holger



More information about the gradsusr mailing list