Hi,

I am able to open a text file, write in the opened text file, load the text file for reading, but am not able to figure out a proper of reading the values.

I have separated values by commas.

The values in the text file is as follows :
71, 72, 81, 72, 72, 81, 73, 72, 81, 75, 72, 81, 77, 72, 81,

I want to read as
A = 71
B = 72
C = 81

And then again
A = 72
B = 72
C = 81

And again ...

And

Also i am not sure whether am using the peek function correctly


The code is as below :-

----------------------------------------------------------------------------

'For writing the values in the text file ... this is working fine ...

TxtWrite = TxtFile.CreateText("C:\File.txt")

TxtWrite.Write(A)
TxtWrite.Write(",")
TxtWrite.Write(B)
TxtWrite.Write(",")
TxtWrite.Write(C)
TxtWrite.Write(",")

'Am not able to read it ...

TxtRead = TxtFile.OpenText(FNameTxt)

ReadAgain:

While TxtRead.Peek = ","

Dim A As Double
A = TxtRead.ReadToEnd
MsgBox(A)

End While

While TxtRead.Peek = ", "

Dim B As Double
B = TxtRead.ReadToEnd
MsgBox(B)

End While

While TxtRead.Peek = ", "

Dim C As Double
C = TxtRead.ReadToEnd
MsgBox(C)

End While

Goto ReadAgain
TxtRead.Close()

End Sub

----------------------------------------------------------------------------------


Thanx in Advance