Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

create a text file (write and read onto it)

Hi all,

Please help me out.

Private Sub record()
Open "History.txt" For Append As #1
Write #1, vbNewLine & Date & " at " & Time & " - " & nom
Close #1
End Sub

Above are the codes I used to generate a .txt file. It's working but whenever I open the text file, it contains the text in between two apostrophy ("date time"). How can I create a text file that will not show apostrophy? The text file contains below:

"15-Jun-05 at 01:26:08 AM - Host - ok?ok?"
"
15-Jun-05 at 01:26:16 AM - Host - ok?"

i doesn't want that: ""
any idea?

Thanks a lot guys
[638 byte] By [ckwai85] at [2007-11-11 10:30:24]
# 1 Re: create a text file (write and read onto it)
Use Print # instead of Write #.
Phil Weber at 2007-11-11 17:22:38 >
# 2 Re: create a text file (write and read onto it)
That works~! Thanks a lot.

How can I print on the same line of the text file?
Everytime I print, it will save the text in the next new line, but I want it to be on the same line.
Any idea?
ckwai85 at 2007-11-11 17:23:38 >
# 3 Re: create a text file (write and read onto it)
Put a semi-colon at the end of the Print # line:

Print #1, "This is a ";
Print #1, "test."
Phil Weber at 2007-11-11 17:24:36 >