Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

wah_on_2

How to remove ("") in text file using VB?

This topic is 6154 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i am a beginner on Visual Basic. I use open "test.txt" for output as #1 write #1, "testing" close #1 but the text file is ("testing"). How can i remove the ("") Thx a lot of! ^^

Share this post


Link to post
Share on other sites
Advertisement
There''s a number of different ways a file can be opened, check up on the VB help for Open.

For more control, it''s sometimes better to open the file in binary mode:

''don''t hardcode file handle numbers e.g. #1,
''better to use freefile to give you an available handle
Dim hFile As Long

hFile = FreeFile
Open "test.txt" For Binary Access Write As #hFile
Put #hFile, , "testing"
Close #hFile

In binary you will have to put in things like carriage return line feed characters yourself, e.g.:

Put #hFile, , "testing1" & vbCrlf
Put #hFile, , "testing2" & vbCrlf

Share this post


Link to post
Share on other sites
Personally, I use

print #1, "testing"

Which works fine.

All your bases belong to us (I know. It''s irony.)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!