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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Wed Jan 03, 2007 8:34 am   

[1.24] {} expansion in an alias/trig/etc
 
Can anyone else confirm this? say is not an alias but say2 is

Code:
#TRIGGER "test" {test (%w)} {
say {This is a %1 example}
say2 {This is a %1 example2}
}
#ALIAS say2 {say %1}


#ECHO test someword
outputs:
say 28 //incorrect the 28 refers to the location of STR 'This is a ' in the compiled code tab
say This is a someword example2 //Works correctly if it is an alias calling it.
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Wed Jan 03, 2007 12:48 pm   
 
Confirmed.

Interestingly, if you change the pattern to test ($asd) and output to 'say $asd' then it works.
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Thu Jan 04, 2007 11:08 am   
 
Presumably changing to a local variable works since you have no braces with the say, removing the braces from the say in nexela's code has the same result, it works. I think this would be the correct syntax too as there is no need for grouping things into one string since say has no internal meaning to CMUD and the whole lot just needs sending to the mud. The same could be done with the say2 line if the alias was modified to use %-1 or the newer %params.
_________________
Taz :)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Jan 17, 2007 8:52 pm   
 
Yes, it's a problem with using {} when you are not using an alias. I've added this to the bug list.
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Wed Jan 17, 2007 11:14 pm   
 
I'm not altogether certain I'd call it a bug. If all those words are meant to be sent to the mud the brackets are superfluous.
_________________
Taz :)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Jan 17, 2007 11:34 pm   
 
Well, I think that if I type

say {hello}

on the command line, that I expect "say {hello}" to be sent to the MUD and not "say 28". That's the bug.
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Wed Jan 17, 2007 11:49 pm   
 
Ah yes of course, apologies.
_________________
Taz :)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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