Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21238

[RESOLVED] How to run periodically a process

$
0
0
Hello,
I want to check automatically, at certain time intervals, if a folder has some files which I am interested in. For this purpose I chose to use the classic timer control checking per second if my time event ( my preset time = timer) is met. However, I feel it is not the best approach and I would appreciate any other opinions about it.
Code:

Private Sub Form_Load()
    Timer1.Interval = 100
End Sub

Private Sub Timer1_Timer()
    Dim clock As String
        clock = Left$(Format(Time, "hh:mm:ss AM"), 8)
 
        Label1.Caption = clock
    If clock = "14:25:00" Or clock = "16:10:00" Or clock = "17:30:00" Then
        Call checkFolder
    End If
End Sub

Private Sub checkFolder()
      'check if some files exist in a folder
End Sub


Viewing all articles
Browse latest Browse all 21238

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>