Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Hazram
Wanderer


Joined: 24 May 2005
Posts: 71

PostPosted: Wed Aug 10, 2011 7:48 am   

Execute a path via indirect reference
 
I'd like to execute a path, via script, whose name is stored in a variable. So /Vars/myPath = "homeToArena", and homeToArena is a path. However, at run time I don't know what path name is stored in @myPath. I was hoping .{myPath} would work, but no dice. I don't see any function or command to execute a path, aside from the dot-notation.

Can this be done?
Reply with quote
orphean
Apprentice


Joined: 21 Oct 2008
Posts: 147
Location: Olympia, WA

PostPosted: Wed Aug 10, 2011 8:51 am   
 
You can use #EXECUTE for stuff like this. It will expand any variables and then run the commands normally.

Code:
#execute {.@myPath}
Reply with quote
Hazram
Wanderer


Joined: 24 May 2005
Posts: 71

PostPosted: Wed Aug 10, 2011 11:14 pm   
 
Thanks much.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net