473,382 Members | 1,367 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

VB6 form not responding while reading long text file

10
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.
Jan 2 '08 #1
13 5442
debasisdas
8,127 Expert 4TB
why don't you read the entire file at once and then process the data line by line .
Jan 2 '08 #2
rizzie
10
why don't you read the entire file at once and then process the data line by line .
tnx 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..
Jan 2 '08 #3
debasisdas
8,127 Expert 4TB
but that certainly involvs less disc I/O.
Jan 2 '08 #4
VijaySofist
107 100+
tnx 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..
Hi!

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. R
Jan 2 '08 #5
CyberSoftHari
487 Expert 256MB
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.
Jan 2 '08 #6
rizzie
10
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.
Hei guys.. Thanks for helping me.. I just need DoEvents inside the loop.. Thanks again...
Jan 3 '08 #7
Killer42
8,435 Expert 8TB
Note: You cannot read file content line by line.
I think we have a bit of a language mix-up here. I use VB6 to "read file content line by line" all the time. So what are you referring to, Hari?
Jan 4 '08 #8
CyberSoftHari
487 Expert 256MB
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

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..
Jan 4 '08 #9
Killer42
8,435 Expert 8TB
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? :)
Jan 4 '08 #10
CyberSoftHari
487 Expert 256MB
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.
Jan 4 '08 #11
Killer42
8,435 Expert 8TB
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.
It's quite amazing (and amusing) sometimes to see the hoops that people jump through to perform a simple function - am I right? :-)
Jan 4 '08 #12
CyberSoftHari
487 Expert 256MB
yes .
Jan 4 '08 #13
maybe you can add Doevents in your looping
Mar 6 '10 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: muser | last post by:
With the following code I'm trying to read a text file (infile) and output inaccuracies to the error file (printerfile). The text file is written and stored on disk, while the printerfile has to be...
2
by: Citoyen du Monde | last post by:
Trying to get some ideas on a simple javascript project (to teach myself the language). I want to develop a client-side vocabulary practice application that would allow users to enter their own...
0
by: Eric Lilja | last post by:
Hello, I have a text file that contains a number of entries describing a recipe. Each entry consists of a number of strings. Here's an example file with only one entry (recipe): Name=Maple Quill...
3
by: dale zhang | last post by:
Hi, I am trying to read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp The article author is using PictureBox for windows...
4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
104
by: Colin McGuire | last post by:
Hi, is there a way to show a form without a titlebar (and therefore no control box/minimize box/title etc) but still have it appear looking like 3D? The property FormBorderStyle to None - this...
5
by: jobi | last post by:
Hi, I'm trying to develop this vb.net application which gathers info. When I start the gathering process, I refresh text-fields in the form to see progress and to see where it gets. This works...
0
by: EPDJ | last post by:
Well, I have to edit a program which we previously used for reading a header file to be able to read a trailer from a .dat file. The .dat file consists of 5 entries in each record and I am assuming...
19
by: Coward 9 | last post by:
HI, I saw in an example hello.aspx, there is a <form tagbeing used like <form runat="server> I search all html tag references and could NOT find "runat" attributes for <formtag. which...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.