|
Potato Newbie
Joined: 26 Oct 2004 Posts: 1
|
Posted: Tue Oct 26, 2004 9:14 pm
Padding values with spaces |
I am trying to get an output in a window to be nicely formatted. I basically have 2 different variables that I concatenate together to get them to be on the same line, and then start a new line for the next set. I have 2 variables that are storing string as a String List.
I want the second variable to start its output starting at column 30, so what i was trying to do is output line number 1, then i wanted to try to do something like
Code: |
#MATH padlen 30-%len(%1)
;find a way to add @padlen spaces to variable padding
%concat(@padding,%2)
|
That way all of %1 will be starting at the same place and %2 will be aligned 30 "spaces" from the start.
So what im asking is how i can either:
1] Dynamically add spaces to that variable
2] Have a cleaner/easier way in order to get my output to be matched up nicely (like an excel file)
Thanks |
|
|
|
Serentus Apprentice
Joined: 28 Sep 2001 Posts: 103 Location: USA
|
Posted: Wed Oct 27, 2004 4:06 am |
You could try the %format() function.
%format("&-30s&-s",%1,%2)
should do what you want. |
|
_________________ -Serentus- |
|
|
|
Danlo Magician
Joined: 28 Nov 2003 Posts: 313 Location: Australia
|
Posted: Wed Oct 27, 2004 4:57 am |
You might try searching the finished scripts forum. Iirc, Charbal made a script for neatly aligning things.
|
|
|
|
|
|