Semicolon v ampersand as concatenation delimiter with debug.print

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Top Spin (ToppSpin_at_hotmail.com)
Date: 11/05/04


Date: Fri, 05 Nov 2004 09:29:27 -0800

The ampersand (&) is a regular operator that will concatenate data of
various types into a string:

  q = "abc" & var1 & 123

The semicolon (;) appears to be part of a special syntax used with
Debug.Print that has a similar, but not identical, function:

  Debug.Print "abc"; var1; 123

It appears that the ";" also converts any data into a string, but for
numeric data, it also adds a leading space and, except for the first
value, a delimiting space.

  Debug.Print 123; 123; 123

results in:

   123 123 123

where there is 1 space before the first value and 2 between subsequent
values.

Are there any other rules for this? Is it documented anywhere? (ha-ha)

Thanks

--
Running MS VB 6.0 Pro (SP5)
PC: HP Omnibook 6000
OS: Win 2K SP-4 (5.00.2195)
Email: Usenet-20031220 at spamex.com
(11/03/04)


Relevant Pages

  • Re: EXCEL: How to scan text reversed (like ACCESS: InStrRev)?
    ... Not sure whether this will help, but you could use this array - ... to return each character as an array element. ... specific instance of a character in a string. ... this formula gives you the number of semicolon in the ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Compensating for Bad Data
    ... I have all the string manipulation down. ... Dim rs As DAO.Recordset ... I need to leave the value alone if the two sides of the semicolon are ... compare the value before and after the semicolon-space ...
    (microsoft.public.access.externaldata)
  • Re: =?UTF-8?B?UHJvYmxlbSByZXR1cm5pbmcgaWRlbnRpdHkgZnJvbSBTUUwgU2Vy?= =?UTF-8?B?dmVyIHdoZW4gc
    ... It worked fine until I typed a semicolon into one of the string fields to be inserted. ... The string fields are inside single quotes in the INSERT command. ... With the semicolon in the string, the record is written correctly including the semicolon, but the identity is not returned. ... Dim MyCommand As SqlCommand = New SqlCommand ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Compensating for Bad Data
    ... user started an answer with a "; ") where my string manipulation was flawed. ... dim v2 as variant ... I need to leave the value alone if the two sides of the semicolon ... compare the value before and after the ...
    (microsoft.public.access.externaldata)
  • Re: Semicolon problem
    ... Dim sStr As String ... For Each cell In Selection ... If ans = vbYes Then ... > Sorry guys, when i created the thread i wanted to make the wrong> semicolon BOLD, but instead it added a * at both sides of the ...
    (microsoft.public.excel.programming)