Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: how to make the function such as "$pad with"? (Read 3354 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

how to make the function such as "$pad with"?

how to make the function such as "$pad_with(string a,string b,number)
the fake code means pad n "string-b"s after "string-a" to fit the whole char number to the number of "number"....
how to make this work?
anybody hele me some code?

how to make the function such as "$pad with"?

Reply #1
Maybe you should do something like this:
$cut(<string a>$repeat(<string b>,X),Y)

1) You should replace X with a big number so it repeats the string b enough.
2) Y is the number of characters to show

how to make the function such as "$pad with"?

Reply #2
or just use the following:
$pad(stringA,$add(X,1))
$replace(stringA,$char(32)$char(32),stringBstringB)
$cut(stringA,X)



this does the following:
- First a  normal Pad to X+1 characters.
- Replaces two spaces by two stringB's. This leaves us with the last char beeing either space or stringB..
But that doesn't matter, since we then do:
- Cut the last char ;-)))

In short:
$cut($replace($pad(stringA,$add(X,1)),$char(32)$char(32),stringBstringB),X)

;-)

how to make the function such as "$pad with"?

Reply #3
oh,thx all of u...i had try ur suggestions that did work...
but,i found a new problem,i had set the playlist font to "Tohama",the font had different width for each letter,so i can't just pad chars....
and foobar seems don't have such function as output a certain char's relative position....so i can't make the playlist in order.....
just like this....

Code: [Select]
001|---Album artists---------|01:artist-title------------------------ length
002|              -Album-                        |02: artist-title                         length
003|                                         |03:artist-title                                  length
004|                                         |04:artist-title                                  length


as u can see..the each letter have the different width,although the distance between two char "|" is equal
they still cann't in orderliness....i am amzing........

how to make the function such as "$pad with"?

Reply #4
You can fix that problem by using a monospaced font (e.g. "Terminal" instead of "Tohama") as Playlist font.

how to make the function such as "$pad with"?

Reply #5
Quote
oh,thx all of u...i had try ur suggestions that did work...
but,i found a new problem,i had set the playlist font to "Tohama",the font had different width for each letter,so i can't just pad chars....
and foobar seems don't have such function as output a certain char's relative position....so i can't make the playlist in order.....
just like this....

Try inserting $char(9) randomly into your title formatting and see what happens.