Yep - sorry. Better to use a class.
@Lakhtin_V - creating & using a class is relatively easy. Move the code that you want to access from multiple activities to the class, initialize the class in your Starter service, then access it from anywhere.
Erel has written a pretty comprehensive tutorial on classes here ->
Classes tutorial
Below is a quick & dirty example of how you might implement a class in your case.
'================================================
'Class module (eg: "clsDBUtils")
Sub Class_Globals
' Class member variable declarations
Private m_Something as Int
End Sub
'Initializes the class. You can add parameters to this method if needed.
Public Sub Initialize(initVal as Int) 'Note - initVal is not required. It's just to show you how to use parameters in your class initialization
m_Something = initVal
End Sub
'Getter & Setter for m_Something member variable
Public Sub getSomething() as Int
Return m_Something
End Sub
Public Sub setSomething(val as Int)
m_Something = val
End Sub
Public Sub ExecuteRemoteQuery(Query As String, JobName As String)As ResumableSub
....
Return nInternet
End Sub
'======================================================
'=====================================================
'Starter service
Sub Process_Globals
Public cDBUtils as clsDBUtils
End Sub
Sub Service_Create
cDBUtils.Initialize(999)
End Sub
'=======================================================
'======================================================
'Activity
Wait For(Starter.cDBUtils.ExecuteRemoteQuery(strQuery, "ALL_WORK")) Complete (Result As Int)
- Colin.