Compile function Tool_Class_Services(@Service, @Params) #pragma precomp SRP_PreCompiler $insert LOGICAL $Insert SERVICE_SETUP $Insert TOOL_CLASS_EQUATES Declare subroutine Error_Services Declare function Error_Services, Database_Services GoToService Return Response or "" //----------------------------------------------------------------------------- // SERVICES //----------------------------------------------------------------------------- Service GetNumberOfPointsForPattern(ToolClass, PatternName) If Unassigned(ToolClass) or ToolClass EQ '' then Error_Services('Add', 'invalid tool class') end If Error_Services('NoError') then If Unassigned(PatternName) or PatternName EQ '' then Error_Services('Add', 'invalid pattern name') end end If Error_Services('NoError') then ToolClassRecord = Database_Services('ReadDataRow', 'TOOL_CLASS', ToolClass) If Error_Services('HasError') then Error_Services('Add', 'tool class record not found') end If Error_Services('NoError') then Locate PatternName in ToolClassRecord using @VM Setting idx then Response = ToolClassRecord end NumberOfPatterns = DCount(ToolClassRecord, @VM) If idx GT NumberOfPatterns then Error_Services('Add', 'pattern name not found') end PatternSizeCount = DCount(ToolClassRecord, @VM) If idx GT PatternSizeCount then Error_Services('Add', 'number of points not found') end end end End Service