Visual Basic Explorer
Visual Basic Explorer
 Navigation
 Home


 Coding
 Source Code

 FAQ Center

 VB Tips

 Downloads

 ToolBox

 Tutorials

 VB Games

 VB News

 VB Award

 VB Forums



 Affiliates
 Planet Source Code

 Rent a Coder

 DirectX4VB


 Misc
 Search

 Feedback

 Advertise

 About


Need to hire
a VB coder?

Please support our sponsor:

 Home 
 Site Map 
 Forums 
 News 
 Feedback 

 

'------------------------------------------------------
'How To: : Write quotation marks to a text file
'Posted: 07-July-98
'------------------------------------------------------
Q: I need to add a line similar to the following to a text
file using Visual Basic 5.0 and can`t get the quotation
marks to work.

 
set var b "george"

 

 
A: Try to join the string with the embedded "chr(34)" like so:

 
String = String & chr(34) & " Hello " & chr(34) & "!"
Print String

 
this would look like:

 
"Hello"!

 
A: As far as I know (and that`s not all that far), you cannot
include a quotation in a string by typing it in. VB, of course,
considers it to be one of the string`s delimiters. However, you
can include a Chr$(34), which is the ascii value for the quotation
mark. Better, you might add the quotes when you write the string
out to the file:

 
MyStr = "George"

 
Print #1, Chr$(34) & MyStr & Chr$(34)

 
Hth,

 
Bob Walsh


Downloads

In IE right-click and select 'Save Target As...' or in Netscape right-click and select 'Save Link As...'

 

View Plain Text View Plain Text
Download Demo Project Not Available
View Code Online Not Available





Home | About | What's New | Source Code | FAQ | Tips & Tricks | Downloads | ToolBox | Tutorials | Game Programming | VB Award | Search | VB Forums | Feedback | VBNews | Copyright & Disclaimer | Advertise | Privacy Policy |

Quick searches: Site Search | Advanced Site Search 

Copyright 2002 by Exhedra Solutions, Inc.
By using this site you agree to its terms and conditions
VB Explorer and VBExplorer.com are trademarks of Exhedra Solutions, Inc.