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


Joined: 08 Aug 2009
Posts: 8

PostPosted: Fri Jul 09, 2010 1:57 pm   

[3.22 Pro] Status window no longer evaluates
 
The title says it all. I have a few %if and %ansi functions used in my status window, and it's just displaying the raw code that it used to evaluate perfectly:
Quote:
%ansi(reset)sp07: %switch(@sp07=1,%ansi(green,high)O,@sp07=0,%ansi(red,high)X,1,?)
%ansi(reset)sp05: %switch(@sp05=1,%ansi(green,high)O,@sp05=0,%ansi(red,high)X,1,?)
%ansi(reset)vio06: %switch(@vio06=1,%ansi(green,high)O,@vio06=0,%ansi(red,high)X,1,?)
%ansi(reset)sp09: %switch(@sp09=1,%ansi(green,high)O,@sp09=0,%ansi(red,high)X,1,?)
%ansi(reset)vio13: %switch(@vio13=1,%ansi(green,high)O,@vio13=0,%ansi(red,high)X,1,?)
%ansi(reset)sp11: %switch(@sp11=1,%ansi(green,high)O,@sp11=0,%ansi(red,high)X,1,?)
%ansi(reset)vio10: %switch(@vio10=1,%ansi(green,high)O,@vio10=0,%ansi(red,high)X,1,?)
Reply with quote
Zugg
MASTER


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

PostPosted: Fri Jul 09, 2010 4:54 pm   
 
It's because you are using incorrect syntax and are not properly enclosing your literal string values within quotes. Specifically, the problem is with the ? at the end. If you want to display a literal ? value, then put " quotes around it. This works fine:
Code:
%ansi(reset)sp07: %switch(@sp07=1,%ansi(green,high)O,@sp07=0,%ansi(red,high)X,1,"?")

The newer version of CMUD treats the arguments to %switch and %if and %case as expressions to be evaluated rather than strings by default. So string values need quotes around them. Technically you should also have quotes around the "O" and "X" strings in your expression too.
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