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
wrym
Magician


Joined: 06 Jul 2007
Posts: 349
Location: The big palace, My own lil world

PostPosted: Wed Mar 03, 2010 1:28 am   

%format & %ansi
 
%format doesn't accurately return padded strings with "&#s", or colors with "&4d"

From blank session command line:

Code:
#show {x%format("&4s", 5)xx%format("&4s", %ansi(red)5)x}
#show {x%format("&4d", 5)xx%format("&4d", %ansi(red)5)x}


The first line shows up colored properly, but is missing the spaces, where the second line shows up properly spaced, but no color.
_________________
"To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle
Reply with quote
wrym
Magician


Joined: 06 Jul 2007
Posts: 349
Location: The big palace, My own lil world

PostPosted: Wed Mar 03, 2010 1:34 am   
 
I take that back any other format besides "&#s" strips the color, and instead of returning a 5 returns 0
_________________
"To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle
Reply with quote
chosig
Novice


Joined: 20 Apr 2008
Posts: 39
Location: Sweden

PostPosted: Wed Mar 03, 2010 7:24 am   
 
Code:
#show {x%format("&4s", 5)xx%ansi(red)%format("&4s", 5)x%ansi(default)}

Put the %ansi outisde the %format.
Reply with quote
wrym
Magician


Joined: 06 Jul 2007
Posts: 349
Location: The big palace, My own lil world

PostPosted: Wed Mar 03, 2010 1:17 pm   
 
Yeah, I know I can, but where i'm using this it gets very long and not nearly as pretty. But beyond that, it's is acting inconsistent between it's different formatting options.
_________________
"To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Mar 03, 2010 2:04 pm   
 
I wouldn't expect %ansi to work well inside a %format statement, since the ansi code itself takes up space. Chosig is correct, the %ansi belongs outside the %format.

[Edit] And as for it acting differently between different formatting options, ansi codes are not a number, and won't work well inside a numerical format.
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