Solved

Read text file

Posted on 1999-01-19
5
152 Views
Last Modified: 2010-05-03
I am reading a text file.  The way it works is I call a DLL then I have a timer control, read the text file that the DLL produces.  When the timer reads the file, it puts it in a text box on my form.  When the DLL is done processing it's data, it says in the file "Processing complete", but my timer control keeps reading the file.  I need to disable it, the way I want to do it is put some more code into the timer control telling the control to disable it's self when it comes accross this text "Processing complete" , but I don't have a lot of experience working with text file and characters.  So could someone please put some sample code up for me.  Thanks
0
Comment
Question by:strongd
5 Comments
 
LVL 4

Expert Comment

by:chabaud
ID: 1469407
To disable the timer:

timer1.Enabled = False
0
 
LVL 9

Accepted Solution

by:
Dalin earned 50 total points
ID: 1469408
Assume you have the text displayed in the textbox named txtFromFile:

Add the code to your read-the-file process

If Instr(txtFromFile, "Processing complete")> 0 then timer1.Enabled = False      
0
 
LVL 3

Expert Comment

by:jjbyers
ID: 1469409
A better way might be to fire an event in your DLL and have your project use the withevents keyword.
0
 

Author Comment

by:strongd
ID: 1469410
Thanks a lot.  I worked great!!!!  I'll be back soon with more questions.......
0
 

Author Comment

by:strongd
ID: 1469411
It worked great!!!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now