VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Display Quotes easily

by Alexander Rendar (1 Submission)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (5 Votes)

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

Rate Display Quotes easily

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.

Download this snippet    Add to My Saved Code

Display Quotes easily Comments

No comments have been posted about Display Quotes easily. Why not be the first to post a comment about Display Quotes easily.

Post your comment

Subject:
Message:
0/1000 characters