WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Strings

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Colon Concatenation Vs StrCat

 Keywords: Colon Concatenation Vs Versus StrCat Operator Preferable

Question:

Are there situations when StrCat is still preferable over using Colon operator?

Answer:

The ':' string concatenation operator concatenates two strings (or values which can be converted to strings).

The single colon (:) is an overloaded operator in WinBatch because it is both a type indicator and the string concatenation operator.

If you want to use the concatenation operator in a COM method parameter, you need to specify the parameters type first so that the parser will interpret the rest of the colons as the concatenation operator. The line should be

document.writeln(:"<h2>Location Information</h2>" : "<p>" : shtml : "</p>")
In this case, I prefer to use StrCat.

Also, StrCat has a slight speed advantage over the colon concatenation operator. Normally, this difference is *not* discernible but under certain conditions, like tight looping structures with with numerous iterations, StrCat may be preferred.


Article ID:   W18283
Filename:   Colon Concatenation Vs StrCat.txt
File Created: 2012:11:13:08:54:12
Last Updated: 2012:11:13:08:54:12