enigmaos
September 6th, 2001, 03:29 PM
I can't figure out why this code doesn't display the whole text file. There are 86 numbers in that text file. For example,
11111
22222
33333
44444
55555
.
.
.
Only the first 13 numbers are displayed in the textbox, but the rest are just blanks, Chr(13), and Chr(10).
Does any of you know why it's doing that?
THANKS!!!!
Dim FileNum as string, strText as string, tmpPath as string
Dim i as Integer, EndPos as Integer, tmp as Integer
tmpPath = "C:\My Documents\Test.txt"
FileNum = FreeFile
Open tmpPath for input as FileNum
strText = input$(LOF(FileNum), #FileNum)
Close #FileNum
'### Chr(10) and Chr(13) are seperators ###
strText = Replace(strText, Chr(10), "")
i = InStr(1, strText, Chr(13))
EndPos = 1
tmp = i
'### Display every number ###
Do While i > 0
me.Text1.Text = Text1.Text & Chr(10) & mid(strText, EndPos, tmp)
EndPos = EndPos + i
i = InStr(i + 1, strText, Chr(13))
Loop
enigmaos@yahoo.com
11111
22222
33333
44444
55555
.
.
.
Only the first 13 numbers are displayed in the textbox, but the rest are just blanks, Chr(13), and Chr(10).
Does any of you know why it's doing that?
THANKS!!!!
Dim FileNum as string, strText as string, tmpPath as string
Dim i as Integer, EndPos as Integer, tmp as Integer
tmpPath = "C:\My Documents\Test.txt"
FileNum = FreeFile
Open tmpPath for input as FileNum
strText = input$(LOF(FileNum), #FileNum)
Close #FileNum
'### Chr(10) and Chr(13) are seperators ###
strText = Replace(strText, Chr(10), "")
i = InStr(1, strText, Chr(13))
EndPos = 1
tmp = i
'### Display every number ###
Do While i > 0
me.Text1.Text = Text1.Text & Chr(10) & mid(strText, EndPos, tmp)
EndPos = EndPos + i
i = InStr(i + 1, strText, Chr(13))
Loop
enigmaos@yahoo.com