Fergus Cooney said:
There was a question about formatting only yesterday. This is what I gave:
Hmm... didn't see that one.
The ToString method of numbers and strings takes formatting parameters which
you can read about here.
Yeah... I use to do something like that in VB6. The only big thing I've run
across is since each 'character' is not the physically same 'width', it's just
a lot of screwing around to get the formatting just right. IE: a 'P' is not
the same width as a '-'. So you get 150 "P" on a line... and 240 "-". Argh!
And when you are dealing with strings having different lengths!
I think it was back in some older VB there use to be a way you could setup a
format of a line mixing strings and number. Kinda like:
LineFormatLike = "/ / '###.##' / / / /"
.... where you could place text between the / / (and they would control
the number of characters depending on how many 'spaces'). ### dealt with
numbers.
I'll look them up.
And then there are quite a few functions for playing with strings.
For instance you could use
sSomething.PadLeft (10, " "c) 'Right-aligned in a 10-width column
Hmmm... didn't know the " "c option. Kewl!
Thanks (as ususal) I:
==================================================
Thought for the day
LOL... I've hundreds of One-Liners....
* All of my REALLY GOOD Sigs are one character too lon
* Don't play stupid with me... I'm better at it!
* Girls with the most streamlined curves offer the most resistance!
* I think I'm suffering from mood poisoning, it must be something I hate!
* It takes a lot of brains to enjoy satire, humor and wit - but none to be
offended by them.
* No, there are no more bugs! (what the?) ///\oo/\\\ ///\oo/\\\
* There are 3 kinds of people: those who can count & those who can't!
* Without my ignorance, your knowledge would be meaningless!