W
Walter Briscoe
I run VBA in Microsoft Visual Basic 6.5.1053 from Microsoft Office Excel
2003 (11.8332.8333) SP3 from Windows Vista Business Service Pack 2.
1) What help topic specifies the rules for forming a VBA string literal?
AFAIK, these are something like: A string literal is a sequence of
characters, starting and ending with a quote, in which a quote is
represented by two quotes.
e.g. "Hello, World" which has the value Hello, World and
"""Hello, World""" which has the value "Hello, World".
I think that a string literal can't specify more than one line.
e.g. This is an error:
"Hello,
World".
Backslash is not an escape character.
e.g. The value of """Hello, \r\nWorld""" is "Hello, \r\nWorld".
If You want that vbCrLf is your friend.
e.g. """Hello, " & vbCrLf & "World""".
When I ask for help on string literal, I get a myriad of hits, none of
which seem relevant to my interest.
2) How is help data organised, physically? If I could grep (a UNIX text
search program) the text, I might get a pointer to the answer to 1)
above, and subsequent awkward help questions. I may be looking in the
wrong place for the answer to 1).
Microsoft has a VBA specification document.
<http://msdn.microsoft.com/en-us/library/dd361851(v=prot.10).aspx>
points to
<http://download.microsoft.com/download/0/a/6/0a6f7755-9af5-448b-907d-
13985accf53e/%5BMS-VBAL%5D.pdf>
in which "3.3.4 String Tokens" contains the relevant information. (In
my time, I have read syntax descriptions and believe I understand the
slightly cryptic presentation.) Sadly, I interpret it to mean that
"Hello,
World" is a valid String Token. I can't insert such a token in code.
Please note that my interest is in reading how to create valid string
literal in a help topic, rather than merely knowing how to construct a
string literal.
2003 (11.8332.8333) SP3 from Windows Vista Business Service Pack 2.
1) What help topic specifies the rules for forming a VBA string literal?
AFAIK, these are something like: A string literal is a sequence of
characters, starting and ending with a quote, in which a quote is
represented by two quotes.
e.g. "Hello, World" which has the value Hello, World and
"""Hello, World""" which has the value "Hello, World".
I think that a string literal can't specify more than one line.
e.g. This is an error:
"Hello,
World".
Backslash is not an escape character.
e.g. The value of """Hello, \r\nWorld""" is "Hello, \r\nWorld".
If You want that vbCrLf is your friend.
e.g. """Hello, " & vbCrLf & "World""".
When I ask for help on string literal, I get a myriad of hits, none of
which seem relevant to my interest.
2) How is help data organised, physically? If I could grep (a UNIX text
search program) the text, I might get a pointer to the answer to 1)
above, and subsequent awkward help questions. I may be looking in the
wrong place for the answer to 1).
Microsoft has a VBA specification document.
<http://msdn.microsoft.com/en-us/library/dd361851(v=prot.10).aspx>
points to
<http://download.microsoft.com/download/0/a/6/0a6f7755-9af5-448b-907d-
13985accf53e/%5BMS-VBAL%5D.pdf>
in which "3.3.4 String Tokens" contains the relevant information. (In
my time, I have read syntax descriptions and believe I understand the
slightly cryptic presentation.) Sadly, I interpret it to mean that
"Hello,
World" is a valid String Token. I can't insert such a token in code.
Please note that my interest is in reading how to create valid string
literal in a help topic, rather than merely knowing how to construct a
string literal.