VB 6.0 File Reading

Reading a text file sequentially

Page 1 of 1

3 Replies - 1977 Views - Last Post: 12 February 2009 - 10:11 PM Rate Topic: -----

#1 vidya2009  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 11-February 09

VB 6.0 File Reading

Post icon  Posted 11 February 2009 - 01:30 AM

Please explain me how to read sentence by sentence from a text file where sentence can be a multiple lines. Sentences are separated from using $ sign.
Is This A Good Question/Topic? 0
  • +

Replies To: VB 6.0 File Reading

#2 newProgram  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 160
  • Joined: 28-October 08

Re: VB 6.0 File Reading

Posted 11 February 2009 - 03:06 AM

View Postvidya2009, on 11 Feb, 2009 - 12:30 AM, said:

Please explain me how to read sentence by sentence from a text file where sentence can be a multiple lines. Sentences are separated from using $ sign.

Quote

Have you generate any codes yet? Please post it here between
...
and we will help you to solve your problem.

Was This Post Helpful? 0
  • +
  • -

#3 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 765
  • View blog
  • Posts: 5,095
  • Joined: 08-December 08

Re: VB 6.0 File Reading

Posted 11 February 2009 - 09:11 PM

Take a look at this tutorial that describes file handling in Visual Basic 6:

http://www.dreaminco...wtopic29575.htm
Was This Post Helpful? 0
  • +
  • -

#4 vidya2009  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 11-February 09

Re: VB 6.0 File Reading

Posted 12 February 2009 - 10:11 PM

View PostnewProgram, on 11 Feb, 2009 - 02:06 AM, said:

View Postvidya2009, on 11 Feb, 2009 - 12:30 AM, said:

Please explain me how to read sentence by sentence from a text file where sentence can be a multiple lines. Sentences are separated from using $ sign.

Quote

Have you generate any codes yet? Please post it here between
...
and we will help you to solve your problem.

Public Function ReadSeqFile(StrFile As String)

Dim hFile As Long
Dim File As String
Dim line As String
Dim FileLength

On Error GoTo FileAccessError

Screen.MousePointer = 11
hFile = FreeFile
Open StrFile For Input Access Read Shared As hFile
Do Until EOF(hFile)
Line Input #hFile, StrLine
Call Add_Data_Grid(StrLine) 'Add Data To Grid from TXT file
Loop

MsgBox "Data Loading Completed...", vbInformation, "SWIFT-Load Data from TXT File"
Screen.MousePointer = 0

FileLength = LOF(1) ' Get length of file.
FileLength = FileLen(StrFile) ' Get length of file.

Close hFile
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1