Applies to: the CapeSoft SelfService templates; the thread was posted in the Clarion 9 group and does not name a template chain.
Problem
Calling the SelfService object method GetServiceStatus (string p_ServiceName, *SS_SERVICE_STATUS p_ServiceStatus, long p_Silent=1),long produced compiler errors whatever parameters the poster tried.
Solution
- The second parameter is passed by reference, so it needs a real variable of the status type. Declare a group based on
SS_SERVICE_STATUSin the procedure's Local Data embed point:
status_grp group(SS_SERVICE_STATUS)
end
result long
- Call the method with that group and test the result (0 means the status was read; the group's
CurrentStatethen holds the state):
result = gSelfService.GetServiceStatus('MyServiceName',status_grp,0)
if not result
case status_grp.CurrentState
of SS_SERVICE_STOPPED
of SS_SERVICE_RUNNING
end
end
- A second poster's code does the same with a group named after
SS_SERVICE_STATUSand a class instancesvc, and passes TRUE for the silent parameter. - The original poster reported that the missing status group in Local Data was his problem.
Caveats
- The thread shows posted code, not the template documentation; check the method prototype in your installed SelfService version.
- One poster has used the method for a long time without trouble. Another asked whether it is reliable and said he had read the service state from a DOS request instead; nobody compared the two.
Today (2026)
Likely unchanged, since the cause is a plain parameter type. Not re-tested against a current SelfService release.
Sources: Rupert E. (Oct 2015, the question), Graham D. (Oct 2015), Jeff S. (Oct 2015) in sv.clarion.clarion9.