Ok, how can I find a list of functions supported in VB and in VBScript. My Help is not clear about it, or I don't use it right...
>>>1. You can use "+" for strings - I think there's no differences between "+" and "&" for strings. But code with "&" is more readable - when you saw it, you know that this expression returns string.
>
>Actually, there are some slight differences in the usage, one of them having to do with NULLs, the other having to do with VB's implicit data type conversions.
>
>If you use "&" to concatenate a value with a null value, you get the value:
>"Vin" & null = "vin". If you use the plus sign, you get Null. This can really burn you if you are concatenating fields from an ADO recordset, let's say.
>
>In addition, VB tries to be smart enought to implicitly convert data. So, if one of your fields is not a string, you will see differences in the return values of "+" and "&." As a result:
>2 & 2 ' returns '22'
>2 + 2 ' returns 4
>"2" & 2 ' returns '22'
>"2" + 2 ' returns 4
>"2" & "2" ' returns '22'
>"2" + "2" ' returns '22'
>
>
>
>
>>>2. I never see official documentation how effective is some VB/VBScript function. So you can do your own tests with many CStr's and, for example, Str$'s and see what is the difference.
>
>The $ versions of commands are a touch quicker, and preferable unless you have a reason not to use them. But, generally, VB string concatenation speed is very slow especially when concatenating strings. If possible, and where possible, use byte arrays or fixed-length strings to increase performance....
>
>
>>>3. About Trim() - I prefer safety to speed. If you hard test some function (IN ALL POSSIBLE SITUATIONS) and it never insert spaces, omit Trim(). But often I have no time to these tests...
If it's not broken, fix it until it is.
My Blog