Login | |
|
 |
RE: Some Simple Text Manipulation - 7/8/2007 8:27:48 AM
|
|
 |
|
| |
Fredledingue
Posts: 337
Score: 0
Joined: 5/9/2005
From:
Status: offline
|
Nice set of function. Especialy useful to avoid errors. However for... 'This function removes the number of characters on the left of the String ...I use ... Mid(MyString, xNumber)
_____________________________
Fred
|
|
| |
|
|
|
 |
RE: Some Simple Text Manipulation - 7/9/2007 12:14:57 AM
|
|
 |
|
| |
DiGiTAL.SkReAM
Posts: 1157
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
|
Heh, you know, it never even occured to me that you can use Mid() like that. However, after testing, it seems to give the proper result for the function, it would have to be Mid(string,xNumber + 1) The function has been modified. Thanks!
_____________________________
"Would you like to touch my monkey?" - Dieter (Mike Meyers) "It is better to die like a tiger, than to live like a pussy." -Master Wong, from Balls of Fury
|
|
| |
|
|
|
 |
RE: Some Simple Text Manipulation - 7/11/2007 1:36:26 PM
|
|
 |
|
| |
DiGiTAL.SkReAM
Posts: 1157
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
|
Hi ehvbs, Thanks for the kind words. All of it is pretty simple code, but again, so useful. As to your Space( iNumChar - Len(s1) ) instead of String(iNumChar - Len(s1)," ") question, I use the string method, because someone might want to modify the function to pad it with zeros, or some other character instead of just being able to use spaces. With the string line, it is so easy to just modify it: String(iNumChar - Len(s1)," ") String(iNumChar - Len(s1),"0") String(iNumChar - Len(s1),"~") etc. I guess I should have made a function that would let you pad a string with the string of your choice, said choice being passed ont he commandline, but... I didn't have a need for it right at the moment, and so didn't write it. Heh heh. It should still be easy enough for folks to modify the aformentioned line to accept an argument of a character.
_____________________________
"Would you like to touch my monkey?" - Dieter (Mike Meyers) "It is better to die like a tiger, than to live like a pussy." -Master Wong, from Balls of Fury
|
|
| |
|
|
|
 |
RE: Some Simple Text Manipulation - 7/13/2007 6:43:19 AM
|
|
 |
|
| |
Fredledingue
Posts: 337
Score: 0
Joined: 5/9/2005
From:
Status: offline
|
quote:
ORIGINAL: DiGiTAL.SkReAM Heh, you know, it never even occured to me that you can use Mid() like that. However, after testing, it seems to give the proper result for the function, it would have to be Mid(string,xNumber + 1) The function has been modified. Thanks! Because Mid is used generaly with two var's ex: Mid(text, 5, 10). If you obmit the second var, it returns everything until the end of the word. Cool. And you are right, we must add +1. quote:
I guess I should have made a function that would let you pad a string with the string of your choice, said choice being passed ont he commandline, but... I didn't have a need for it right at the moment ...and because it will make a sub almost as complicated as the full code. [just kidding]
_____________________________
Fred
|
|
| |
|
|
|
|
|