|
Ins0mniak Apprentice
Joined: 27 Apr 2001 Posts: 110
|
Posted: 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. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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)} |
|
|
|
|
|
|
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
|
|