shrug-l: Embedded Quotation Marks
John.Sykes at dep.state.fl.us
Thu Feb 8 11:17:35 EST 2007
OK, everyone here's the solution.
Several people said you need a double quote.
This is true, but if you are starting your string literal with a " mark, you
actually need a triple quote!!! E.g., """
So I found the following would work (assume that LAT_SS = 23.345.
LAT_SS & """ N"
Displays correctly as:
Thanks, it was the third " mark that threw me off.
From: shrug-l-bounces at lists.dep.state.fl.us
[mailto:shrug-l-bounces at lists.dep.state.fl.us] On Behalf Of Sykes, John
Sent: Thursday, February 08, 2007 10:13 AM
To: shrug-L at lists.dep.state.fl.us
Subject: shrug-l: Embedded Quotation Marks
Here's a little bug that bothers me.
In most languages, there is a way to embed special characters in a string
So that, for example if $ has a meaning to a language, you might use %$ in a
literal to tell the language to embed the $ sign in the literal and not run
the $ function (whatever it may be). In this example, a %% would tell the
parser that the literal contains a percent sign.
I have not been able to find a similar feature in the VB scripting language
(I've tried a bunch of the "usual" special characters, but none seem to
work). So in a literal (which starts and ends with a " sign) if you want to
include the " sign as part of the literal, there is no way to tell VB that "
is a symbol and not the end of the string. I have temporarily gotten around
this by using two ' signs in my literals (e.g., for degrees, minutes and
seconds of lat/long) but there has to be a better solution.
I looked through the VB 6.0 manuals and could not find such a solution,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SHRUG-L