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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Ins0mniak
Apprentice


Joined: 27 Apr 2001
Posts: 110

PostPosted: Mon Oct 13, 2003 1:26 am   

Problem with expanding a variable!
 
I'm trying to do this:

#RENAME CommandToAdd CommandNumber@CommandCounter

The problem is, it doesn't evaluate @CommandCounter. I have tried putting %eval() around @CommandCounter, and it makes the new alias name CommandNumber%eval(@CommandCounter). I tried turning on "Expand Variables" in prefs, i tried putting [] around the variable, none of these work. Anyone have a suggestion? The only thing I have got to work is to do this:

#ADD CommandCounter 1
#VAR CommandName {~#RENAME CommandToAdd CommandNumber@CommandCounter}
%exec(@CommandName)

This seems overly complicated though.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Oct 13, 2003 2:56 am   
 
#RENAME performs no expansion on any of its arguments. The best way to force expansion when you need it but the command doesn't do it is to use a combination of #EXEC and %concat.

#EXEC {%concat("#RENAME CommandToAdd CommandNumber",@CommandCounter)}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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