|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Outputting text to a text file with quotes " "
Hello,
I do not know what to search under in google for this. I want to write to a text file a few lines like "hello" (It won't really say hello, that is an example). However, in VB the Print #1, "blagggggg" doesn't like Print #1, ""Hello"" How do I complete this? Thank you, Scott |
|
#2
|
||||
|
||||
|
This code:
Code:
Dim iFp As Integer
iFp = FreeFile
Open App.Path & "\text.txt" For Output As #iFp
Print #iFp, "I want to say ""Hello"""
Close #iFp
Code:
I want to say "Hello" |
|
#3
|
|||
|
|||
|
U can use filesytem object in the vb script to do it..
|
|
#4
|
||||
|
||||
|
Interesting. I have a program that saves the user-defined default printer for that program only that outputs the network name to an .ini, and it has the " ". All I'm doing is
Code:
Write gstrMystring
__________________
Fisherman "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein |
|
#5
|
||||
|
||||
|
It really all depends on how you are dealing with the string, if you are building the string programatically then you will have to handle the quotes appropriately, if you read in a string that has a quote(s) in it, then you need do nothing.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Outputting text to a text file with quotes " " |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|