Solved

Read text file

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

895 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

11 Experts available now in Live!

Get 1:1 Help Now