Long-dynamic-vars (text)

Help Contents Examples Long-dynamic-vars (text)
Lines (simple) Mouse (simple)

Long-dynamic-vars (text)

This simple text example shows how to dynamically create and access variables from words.

make "value 0
make "varname "a 
print :varname 
repeat 6 ;initializing~
[
	make "value :value+1
	(print :varname :value)
	make :varname :value 
	make "varname word :varname :varname 
]
make "varname "a  
repeat 6 ;printing the names~
[
	make "test (list word ": :varname)
	print :test
	make "varname word :varname :varname 
]
make "varname "a 
repeat 6 ;dynamic variable access~
[
	make "test (list ": :varname)
	(print :test run :test)
	make "varname word :varname :varname 
]

Lines (simple) Mouse (simple)