Multiple names of same variable

Posted by Lisev on Tue 05 Jul 2005 08:29 AM — 1 posts, 8,360 views.

Poland #0
It would be nice if I could set multiple names that would refer to the same variable value.

For example:

i create variable with names herb, potato, onion.
world.createvariable "herb|potato|onion"

then, if I:
setvariable "herb", "big herb"
setvariable "potato", "big potato"

and
getvariable "onion" would return "big potato"

Reason for this is some output from the mud can have a few different names, and it would be much faster to refer to proper mushclient variables.

Right now I could do it with:
setvariable "potato", "herb"
world.getvariable(world.getvariable("potato")) to access variable named "herb"

but it is somehow ugly looking code ;)