Hello,
I have Get() & Put() functions in my VB6 project. It was upgraded to FileGet() & FilePut() but they are not working. I am getting the runtime error as "Unable to read beyond the end of the stream."
Eg: FileGet(X, Y, Z) -> I think the parameters are FileGet(FileNumber, Value, RecordNumber). Same for FilePut().
Please inform me how I can change this to make it work in VB.Net.
Regards,
Simran Kaur.
Simran Kaur
0
Newbie Poster
Recommended Answers
Jump to PostYou should look into the uses of StreamReader and StreamWriter.
'Reading files Private Sub ReadFile(Filename As String) Dim stream As New IO.FileStream(Filename, IO.FileMove.Open) Dim sr As New IO.StreamReader(stream) Dim line As String = "" While sr.Peek <> -1 'Read until EOF line = sr.ReadLine End While sr.Close() …
Jump to PostAh. Now I see.
Ok, try this:If TopRecords > 0 Then Rec = 1 Do While Not EOF(FF) '<<--- Replace the For loop with this While loop 'UPGRADE_WARNING: Get was upgraded to FileGet and has a new behavior. FileGet(FF, TopData, Rec) ' If TopData.Deleted = True …
All 7 Replies
Oxiegen
88
Basically an Occasional Poster
Featured Poster
Simran Kaur
commented:
was helpful
+1
Simran Kaur
0
Newbie Poster
Simran Kaur
0
Newbie Poster
Oxiegen
88
Basically an Occasional Poster
Featured Poster
Simran Kaur
commented:
was very helpful & thoughtful
+1
Simran Kaur
0
Newbie Poster
Oxiegen
88
Basically an Occasional Poster
Featured Poster
Simran Kaur
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.