AntoniusMomac wrote:Thanks jpuziano. That Vbscript function will work great.
quick off topic question regarding vbscript, how do you test/run/debug those functions?
The same way as any MS code, write it, run it, read the error msgs, adjust the code, run it again, etc.
If stumped, search the forums here using bits of the error msgs to see if others ran into the same problem and what the solution was. If not, try Googling the web or post here with the problem.
There is the MS debugger of course but I don't think it was built to debug VBscript code. Marcus can no doubt offer you a much more detailed answer on how to best debug the VBscript parts of your code.
For my part, I am just happy I can take advantage of the odd VBScipt function here and there as necessary.
A warning on using the above posted code though... it will fail if your string happens to contain a double quote " so to escape those, you must replace each occurance of " with "" in your string
before passing it to that VBScript function. Take a look at the example Marcus has in the Help file for StringReplace:
- Let>string=Your name is "Fred"
StringReplace>string,","",vbEscapedString
For safety’s sake, I'll modify the code I posted to add a line for this... in case someone finds it and uses it in future.
Take care