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
Rainchild
Wizard


Joined: 10 Oct 2000
Posts: 1551
Location: Australia

PostPosted: Tue Dec 05, 2006 3:52 am   

[1.19] Weird Substitution (28)
 
Ok I was chatting to someone on the MUD and typed the following:

reply (more)

The (more) was substituted for the number '28', so what got typed was

reply 28
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Tue Dec 05, 2006 9:12 am   
 
Ditto (hence why the post below implies I'd mistyped '28', when really CMUD had sent it)
http://forums.zuggsoft.com/phpbb/viewtopic.php?t=25601
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Dec 05, 2006 5:27 pm   
 
It's the parenthesis issue with the command line, which is on the bug list. To understand why it does this, try putting this in an alias and looking at the compiled code. The (more) causes an expression pointer to be pushed onto the stack. When something like the #IF statement needs to evaluate the expression (or #WHILE needs to evaluate it more than once), it can use this pointer to execute the code to evaluate the expression.

But if something isn't expecting an expression pointer (like the command line), then it just sees a value on the stack and thinks it is a literal value that needs to be appended. The '28' is actually the expression pointer (points to location offset 28 in the code). Since the command line isn't expecting an expression, it just sees the pointer and doesn't know that it needs to jump to the code to evaluate it.

In any case, I'm trying to find a way to allow () on the command line without causing expression evaluation.
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