aaronk Well-Known Member Licensed User Longtime User May 7, 2014 #1 Hi, Just wondering, if you have a sub in a Service and you stop the service from the sub will the code after that then work? For example: Service1 Code: Copy Sub RunMe StopService("Service1") ' .. will this code run if It was placed here .. End Sub Would the code run since the service has stopped ? I understand that you need to have the service running to be able to run that sub in the service but just wondering if it would finish running that code or would it stop after the StopService part in the code since it was stopped ?
Hi, Just wondering, if you have a sub in a Service and you stop the service from the sub will the code after that then work? For example: Service1 Code: Copy Sub RunMe StopService("Service1") ' .. will this code run if It was placed here .. End Sub Would the code run since the service has stopped ? I understand that you need to have the service running to be able to run that sub in the service but just wondering if it would finish running that code or would it stop after the StopService part in the code since it was stopped ?
Erel B4X founder Staff member Licensed User Longtime User May 7, 2014 #2 The code will run. StopService sends a message to the internal message queue. Only later when the message queue is processed (which must happen after the current code completes) the service will stop. Upvote 0
The code will run. StopService sends a message to the internal message queue. Only later when the message queue is processed (which must happen after the current code completes) the service will stop.