Help - Search - Members - Calendar
Full Version: $rgb() should be stripped before parsing
Hydrogenaudio Forums > Hosted Forums > foobar2000 > General - (fb2k)
sauce
Try this code:

CODE
$pad($rgb(255,255,0)Artist,10).

It will return "Artist." but it should return "Artist    ." (with spaces inbetween).  
The reason is that $pad() counts the $rgb() characters. Most of the time it can be fixed by placing the $rgb() before the $pad, rather than inside it, but in a few cases I wasn't able to.

Such as this:
$pad($repeat($rgb(255,0,0)♥,$get(rating)),5,·)
Synthetic Soul
QUOTE(sauce @ May 24 2006, 04:34) *
$pad($repeat($rgb(255,0,0)♥,$get(rating)),5,·)
That code wouldn't work as expected anyway, as the "·" would be red also.

I would use either:

$progress2($get(rating),5,5,$rgb(255,0,0)♥,$rgb()·)

... or, more code but less processing (unnecessary repeating of colour codes), and the code I would personally use:

$rgb(255,0,0)$repeat(♥,$get(rating))$rgb()$repeat(·,$sub(5,$get(rating)))

I do agree that $rgb(255,0,0) should not be treated as a string though .
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.