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
