  | 
	
	
	
		wrym Magician
 
  Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
  | 
		
		  
			
			   Posted: 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 | 
			       | 
			 
		   
		 | 
	
	
		  | 
	
	
		wrym Magician
 
  Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
  | 
		
		  
			
			   Posted: 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 | 
			       | 
			 
		   
		 | 
	
	
		  | 
	
	
		chosig Novice
 
  Joined: 20 Apr 2008 Posts: 39 Location: Sweden
  | 
		
		  
			
			   Posted: 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. | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		wrym Magician
 
  Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
  | 
		
		  
			
			   Posted: 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 | 
			       | 
			 
		   
		 | 
	
	
		  | 
	
	
		Rahab Wizard
 
  Joined: 22 Mar 2007 Posts: 2320
 
  | 
		
		  
			
			   Posted: 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. | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		| 
		
		 | 
	
	
		 |