tag:blogger.com,1999:blog-11646261.post5590426142895122510..comments2024-01-02T00:43:44.344-08:00Comments on OakLeaf Systems: Visual Basic Team Starts LINQ Cookbook SeriesRoger Jennings (--rj)http://www.blogger.com/profile/01700526164060680385noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-11646261.post-79175191718172773772007-06-26T09:38:00.000-07:002007-06-26T09:38:00.000-07:00The word put out from Getz et al way back for the ...The word put out from Getz et al way back for the reason "&" was introduced (e.g., in Access VB) was to support concatenation of a Null - the "+" choked on that.<BR/><BR/>Below, the first MsgBox works. The second aborts with "Invalid use of null":<BR/><BR/>Public Sub subTestConcat()<BR/><BR/>Dim varNull As Variant<BR/>Dim strString As String<BR/><BR/>strString = "This " <BR/>varNull = Null<BR/><Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11646261.post-42458708024157966442007-06-25T07:21:00.000-07:002007-06-25T07:21:00.000-07:00You might want to get an actual VB programmer to v...You might want to get an actual VB programmer to vet your suggestions. The very idea of using + for concatination makes me shudder.Jonathan Allenhttps://www.blogger.com/profile/16213908463228592960noreply@blogger.comtag:blogger.com,1999:blog-11646261.post-59518267535159104252007-06-24T19:38:00.000-07:002007-06-24T19:38:00.000-07:00Like Nick said, you should use Char's and the c su...Like Nick said, you should use Char's and the c suffix instead of CChar.<BR/>And the concatentation operator for strings is & and it is the one that should be used. by using & you guarantee that string concatenation is performed under all circumstances (or an exception is thrown).<BR/>The + operator will attempt to do addition if any operand is a numeric. If you consider late bound code this isAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-11646261.post-23045034810410595612007-06-24T16:15:00.000-07:002007-06-24T16:15:00.000-07:00You know that there is a much more abbreviated way...You know that there is a much more abbreviated way of doing string to char conversions in VB.NET, right:<BR/>New Char() {","c, "."c, ";"c, ":"c,""""c,"!"c,"?"c, " "c}Anonymousnoreply@blogger.com