VB6 uses Write # and Input # as simple IO so the following code fragment both reads and writes different types of data:
Dim FHandle As Integer
Dim TestString As String, TestInt As Integer, TestReal As Double, TestDate As Date
TestDate = Now
FHandle = FreeFile
Open “C:Test.txt” For Output As FHandle
Write #FHandle, “String”, 12, 13.4, TestDate
Close FHandle
Open “C:Test.txt” For Input As FHandle
Input #FHandle, TestString, TestInt, TestReal, TestDate
Close FHandle
Note that when you use Write #, certain field types are delimited for simple input parsing so your text file would look like:
“String”,12,13.4,#2014-10-23 16:01:41#
For multiple elements or records, repeatedly use write # and input # (before closing the file :-)).
Cheers, C.