Solved

Read text file

Posted on 1999-01-19
5
154 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

786 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