A
Anonymous
Guest
Thanks to you guys I sorted out my previous problems.
Now for my next challenge. People send me orders but half of them are total bozos and don't realize that a name is supposed to begin with a capital letter so I'll get an order from "mr dougie mcdougal, 26 wentworth boulevard"... etc.
I can't just copy this into the invoice. I have to spend precious minutes retyping it because there's no way I'm going to send out a letter addressed like a five-year-old typed it!
So, I know how to capitalize words. I even found a script that does it intelligently so that "mcdougal" becomes "McDougal" and not "Mcdougal".
What I can't figure out is an elegant way to determine if the first letter is already capitalized (and the last letter isn't). If this is so, then the chances are that everything else is OK. Hmm, I just thought... the last letter might be a comma! Oh, forget that. Let's just test for the first letter in the name being one of A-Z. If the whole name is in capitals I don't care that much.
I've searched the Manual but I can't find an example that specifically addresses this. Maybe you can point me to a page?
Do I have to check for "A - Z" or is it better to look for the actual ASCII number values (how)? Suggestions welcome!
(Many years ago I knew the ASCII numbers off by heart. Now all I can remember is "return" is ASCII 13 and I think "line feed" is 10 and "space" is 20. And maybe "A" is 64 ... but I'm faltering).
Martin
Now for my next challenge. People send me orders but half of them are total bozos and don't realize that a name is supposed to begin with a capital letter so I'll get an order from "mr dougie mcdougal, 26 wentworth boulevard"... etc.
I can't just copy this into the invoice. I have to spend precious minutes retyping it because there's no way I'm going to send out a letter addressed like a five-year-old typed it!
So, I know how to capitalize words. I even found a script that does it intelligently so that "mcdougal" becomes "McDougal" and not "Mcdougal".
What I can't figure out is an elegant way to determine if the first letter is already capitalized (and the last letter isn't). If this is so, then the chances are that everything else is OK. Hmm, I just thought... the last letter might be a comma! Oh, forget that. Let's just test for the first letter in the name being one of A-Z. If the whole name is in capitals I don't care that much.
I've searched the Manual but I can't find an example that specifically addresses this. Maybe you can point me to a page?
Do I have to check for "A - Z" or is it better to look for the actual ASCII number values (how)? Suggestions welcome!
(Many years ago I knew the ASCII numbers off by heart. Now all I can remember is "return" is ASCII 13 and I think "line feed" is 10 and "space" is 20. And maybe "A" is 64 ... but I'm faltering).
Martin