By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,327 Members | 1,805 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,327 IT Pros & Developers. It's quick & easy.

String That Includes Quotes

P: n/a
In a certain processing of a file, I need to enclose the path and file name in
quotes. It looks like this:
"""C:\My Path\My File Name.Ext"""

After dimming StrPath As String, StrFileName As String, setting StrPath = "C:\My
Path" and StrFileName = "My File Name.Ext", what is the syntax to concatenate
StrPath and StrFilename to get the equivalent of the above?

Thanks!

Steve
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Found the answer!

"""" & StrPath & StrFileName & """"

(That's four double quoyes on both ends.)

Steve
"Steve" <sp**@nospam.spam> wrote in message
news:kK*******************@newsread1.news.atl.eart hlink.net...
In a certain processing of a file, I need to enclose the path and file name in
quotes. It looks like this:
"""C:\My Path\My File Name.Ext"""

After dimming StrPath As String, StrFileName As String, setting StrPath = "C:\My Path" and StrFileName = "My File Name.Ext", what is the syntax to concatenate
StrPath and StrFilename to get the equivalent of the above?

Thanks!

Steve

Nov 12 '05 #2

P: n/a
Steve wrote:
Found the answer!

"""" & StrPath & StrFileName & """"

(That's four double quoyes on both ends.)

Steve
"Steve" <sp**@nospam.spam> wrote in message
news:kK*******************@newsread1.news.atl.ear thlink.net...

In a certain processing of a file, I need to enclose the path and file name in
quotes. It looks like this:
"""C:\My Path\My File Name.Ext"""

After dimming StrPath As String, StrFileName As String, setting StrPath =

"C:\My

Path" and StrFileName = "My File Name.Ext", what is the syntax to concatenate
StrPath and StrFilename to get the equivalent of the above?

Thanks!

Steve


Put this in a general declaration section of a standard module.
Public vbDoubleQuote As String
Public vbSingleQuote As String

In some startup routine of your program, put these 2 instructions.
vbDoubleQuote = Chr(34)
vbSingleQuote = Chr(39)

Then you can do this:

strPath = "C:\" & vbDoubleQuote & "My Path\.Ext" & vbDoubleQuote
strFileName = vbDoubleQuote & "My File Name.Ext" & vbDoubleQuote
strPath = strPath & strFileName

It helps make a long string more readable.
Ron

--
Ronald W. Roberts
Roberts Communication
rw*******************@robcom.com
To reply remove "_at_robcom_dot_com"

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.