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
swooster
Newbie


Joined: 19 Jun 2002
Posts: 3
Location: USA

PostPosted: Wed Jun 19, 2002 11:44 am   

Trouble with alias in v6.16
 
I'm new to zmud, and this has been bugging me... For the contents of an alias, I have:

#loop 1,9 {
#key KEY%i {test %i %char}
}

It _does_ manage to set macros for KEY1 through KEY9... however, I'd expect it to set them to "test 1 Charactername", but it instead sets them to "test %{i} Charactername". I find it strange that it correctly expands %char, but not %i or %repeatnum... any idea why this is the case and what I can do about it? Thanks!

-Swooster
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Jun 19, 2002 12:15 pm   
 
When I test it in mine, it expands neither. Looks like you are going to have to use the #EXEC concatenation trick to force expansion. This should do it:

#LOOP 1,9 {#EXEC %concat("#KEY KEY", %i, " {test ", %i, " ", %char, "}")}

Kjata
Reply with quote
swooster
Newbie


Joined: 19 Jun 2002
Posts: 3
Location: USA

PostPosted: Wed Jun 19, 2002 1:17 pm   
 
Thank you! This seems to work very well... I'll be sure to remember it. :)


-Swooster
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