I am currently creating a program in vb6 that reads thousands of lines from a text file. So I use loop to read each line. It works perfectly but the problem occur when I run the program and try to minimize the form or try to use another application. Seems that the form lost it focus and isnt responding though it is still in the state of processing the loop.
VB6 form not responding while reading long text file
Collapse
X
-
-
Originally posted by debasisdaswhy don't you read the entire file at once and then process the data line by line .Comment
-
-
Originally posted by rizzietnx for replying... Is'nt it the same? I mean, If I read the entire file where should I store it?? and how I will retrieve it line by line? I will still use loop right??... sorry Im new to visual basic..
May I Know, For What purpose you are trying to read it Line By Line.
Can you please give your coding here in this forum.
With Regards
Vijay. RComment
-
Simply use DoEvents inside the “for” loop. Then you can resize the form.
Note: You cannot read file content line by line. Whenever you open the file to read then the control starts from the first line in that file because there is no line ID to point the control to a particular line.Comment
-
Originally posted by CyberSoftHariSimply use DoEvents inside the “for” loop. Then you can resize the form.
Note: You cannot read file content line by line. Whenever you open the file to read then the control starts from the first line in that file because there is no line ID to point the control to a particular line.Comment
-
Sorry for the improper explanation.
I mean if you
1. Open the file and read a line
2. Close the file
3. Again open file and try to read second (or any particular line) line. ‘This is not possible
Originally posted by rizzieIs'nt it the same? I mean, If I read the entire file where should I store it?? and how I will retrieve it line by line? I will still use loop right??... sorry Im new to visual basic..Comment
-
I see what you mean. Yes, each time you open the file the pointer will be reset to the beginning.
Technically, in such a case I suppose you could track where you were up to each time, and reposition after opening the next time. But of course, why would you want to? :)Comment
-
I agree it is possible technically to reposition and I just pointed do not try like retrieve data from database table using IDs, because one of my teammate faced same problem in VB.Comment
-
Originally posted by CyberSoftHariI agree it is possible technically to reposition and I just pointed do not try like retrieve data from database table using IDs, because one of my teammate faced same problem in VB.Comment
-
Comment