|
-
Feb 13th, 2000, 09:37 PM
#1
Thread Starter
New Member
I am writing an application that will run as a service on an NT server and has no user interface. The application checks for and processes new records on a cyclical basis. Since there is no user interface all code is running inside code modules. When all new records are processed I initiate a timer (through an api call) to start the process over again after a time delay.
Main()
Initialize system
Call ProcessRequests
Exit Sub
ProcessRequests()
Kill timer if active
Process requests
Set new timer that will return control to ProcessRequests() on time out.
Exit Sub
Unfortunately, unlike forms, the code module does not wait for an event to occur when you exit a sub routine. When ProcessRequests() exits it returns to Main() which also exits. After the program exits Main it loops back to the beginning of Main(). How to I get the program to pause until the timer completes?
Steve
-
Feb 14th, 2000, 10:42 AM
#2
Thread Starter
New Member
Originally posted by r0ach:
This is a long shot (and not very good advice), but it's what i would have done.
Why not just use an empty form, and set it's visible property to false? That way, you have no interface, and your program will wait for events to occur.
Sorry. :/
Thanks for the reply. I realize I could make my life much simpler by using a form but I would like to do this without a form if possible. (I guess I like doing things the hard way!)
Steve
-
Feb 14th, 2000, 12:34 PM
#3
Member
I've never really played with it this way... but do you have a way of checking if the timer is complete?
then you could
Do
If [[the timer is complete]] then TheTimerIsComplete = True
Loop Until TheTimerIsComplete = True
(you would have to find some way of figuring out if the timer is complete (and setting the TheTimerIsComplete variable accordingly)
this would loop forever until the timer is complete.
If I am way out in left field and don't understand anything, pleeze kindly ignore me 
------------------
Rapmaster
-
Feb 14th, 2000, 12:54 PM
#4
Fanatic Member
This is a long shot (and not very good advice), but it's what i would have done.
Why not just use an empty form, and set it's visible property to false? That way, you have no interface, and your program will wait for events to occur.
Sorry. :/
------------------
r0ach(tm)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|