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
SpiritWolf
Wanderer


Joined: 02 Jul 2002
Posts: 74
Location: USA

PostPosted: Tue Mar 16, 2004 9:13 pm   

Expanding a variable containing a command
 
I seem to be having a problem with putting a command in a variable and getting it to work at the start of a line.
Using the following alias you can see what I mean.
#ALIAS test {#var test1 1234567890;#alias testing1 {#var cmd ~#say;@cmd @test1};testing1}

When run, it should use #say and display 1234567890 to the screen, but it instead tries to send #say 1234567890 to the mud.
Am I doing something wrong here, or is this a bug?
Reply with quote
Pega
Magician


Joined: 08 Jan 2001
Posts: 341
Location: Singapore

PostPosted: Tue Mar 16, 2004 9:44 pm   
 
Try running it on your command-line.

'@cmd @test1' would send its contents to the mud.
' #say @test1' won't parse the say command either, because there is a space in front of it,
likewise with '~#say @test1',
and ' test' will send 'test' to the mud instead of parsing the alias.

Instead, do this:
Code:
#ALIAS test {#var test1 1234567890;#alias testing1 {#var cmd ~#say;#exec {@cmd @test1}};testing1}
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Mar 16, 2004 9:45 pm   
 
Chnage the alias like this:
#ALIAS test {#VAR test1 1234567890;#ALIAS testing1 {#VAR cmd ~#say;#EXEC {@cmd @test1}};testing1}
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