Tools Links Login

Display "Quotes" easily!

This is the quickest and most efficient way to display something with Quote symbols (" ")

Original Author: Alexander Rendar

Code

A good message to the user should contain quotes, e.g. File "c:MyFile.txt" was not found.
But how do you actually display the Quote symbols easily? For a few years, I was defining my own sQuoteChar symbol, which was Chr$(34). But doing it was tedious. Lucky for us, there is a better way to display the Quote symbol.


MsgBox ("File ""C:MyFile.txt"" was not found")
Here, when you put 2 quotes together, VB realizes you actually want to show C:MyFile.txt in quotes. Otherwise, you would need an annoyingly long code, like
MsgBox ("File " & sQuoteChar & "C:MyFile.txt" & sQuoteChar & " was not found")
See the difference? Good :)
Hope this is useful to you.

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 84 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.