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.
VB 6.0 File ReadingReading a text file sequentially
Page 1 of 1
3 Replies - 1977 Views - Last Post: 12 February 2009 - 10:11 PM
Replies To: VB 6.0 File Reading
#2
Re: VB 6.0 File Reading
Posted 11 February 2009 - 03:06 AM
vidya2009, 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.
#3
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
http://www.dreaminco...wtopic29575.htm
#4
Re: VB 6.0 File Reading
Posted 12 February 2009 - 10:11 PM
newProgram, on 11 Feb, 2009 - 02:06 AM, said:
vidya2009, 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
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|