Need advice for a baffling error

T

Terry Olsen

I have a Class level variable defined as:

Private _MessageID As String = "Idle"

I have a timer set up with a 5-second interval. Here's the code for the
Timer_Fired event:

Private Sub Timer_Fired(ByVal state As Object)
If _Enabled = False Then Exit Sub
Writelog("MsgID=" & _MessageID)
If _MessageID = "Idle" Then
GetNextArticle()
End If
If _MessageID = "Idle" Then
Exit Sub
End If
ReportStatus("Downloading")
DownloadArticleBody()
End Sub

The first time the timer fires, the GetNextArticle routine populates
_MessageID with the next MessageID to get. So _MessageID no longer equals
"Idle" The problem I'm having is that even though _MessageID contains the
article ID ("<[email protected]>"), it is still calling GetNextArticle again and
it is not exiting the Sub. Here's my Log file...

7/29/2007 10:59:59 PM - Connecting to news.bresnan.net on Port 119
7/29/2007 10:59:59 PM - NNTP Response: 200 news.bresnan.com
7/29/2007 10:59:59 PM - MODE READER
7/29/2007 10:59:59 PM - NNTP Response: 200 News.GigaNews.Com
7/29/2007 10:59:59 PM - MsgID=Idle
7/29/2007 10:59:59 PM - BODY <[email protected]>
7/29/2007 10:59:59 PM - NNTP Response: 222 0 <[email protected]>
7/29/2007 11:00:05 PM - MsgID=<[email protected]>
7/29/2007 11:00:05 PM - BODY <[email protected]>
7/29/2007 11:00:06 PM - NNTP Response: K!?_??)*Me?##DA_)*

At 10:59:59, _MessageID was "Idle" and it retrieved the next article ID. So
far, so good. It began to download the article body.
At 11:00:05, _MessageID was NOT "Idle" but it still retrieved the article ID
and it did not exit the sub.

I can't figure out why the 'If' statements are not working. When the
_MessageID<>"Idle" it should just exit the sub. Can anyone tell me what is
going on?
 
C

Cor Ligthert[MVP]

Nevermind, I'm stupid!There is no better learning school especially when it is so wide
broadcasted.

:)

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top