COMPILE FUNCTION obj_Maint_Item(Method,Parms) /* Methods for MAINT_ITEM table 11/22/2013 JCH - Initial Coding Properties: Methods: *Install(GraphNo,ReactNo,DTM,ReactHrs,ReactWfrs,RL_Id) ;* Adds Reactor Installation line item to record *Remove(GraphNo,ReactNo,DTM,ReactHrs,ReactWfrs,RL_Id,RDSWfrCnt) ;* Adds Removal information to Reactor Installation line item */ DECLARE FUNCTION Get_Status, Msg, Utility, obj_Tables, Send_Dyn DECLARE SUBROUTINE Set_Status, Msg, obj_Tables, Send_Dyn DECLARE SUBROUTINE ErrMsg, Btree.Extract $INSERT MSG_EQUATES $INSERT REACTOR_LOG_EQUATES $INSERT MAINT_ITEM_EQUATES EQU CRLF$ TO \0D0A\ EQU TAB$ TO CHAR(9) ErrTitle = 'Error in Stored Procedure "obj_Maint_Item"' ErrorMsg = '' IF NOT(ASSIGNED(Method)) THEN ErrorMsg = 'Unassigned parameter "Method" passed to subroutine' IF NOT(ASSIGNED(Parms)) THEN Parms = '' IF ErrorMsg NE '' THEN Set_Status(-1,ErrTitle:@SVM:ErrorMsg) RETURN '' END Result = '' BEGIN CASE CASE Method = 'Convert' ; GOSUB Convert CASE 1 ErrorMsg = 'Unknown Method ':QUOTE(Method):' passed to routine.' END CASE IF ErrorMsg NE '' THEN Set_Status(-1,ErrTitle:@SVM:ErrorMsg) END RETURN Result * * * * * * * Convert: * * * * * * * DEBUG RLId = Parms[1,@RM] IF RLId = '' THEN RETURN OPEN 'MAINT_ITEM' TO MaintItemTable ELSE ErrorMsg = 'Unable to open "MAINT_ITEM" for conversion.' RETURN END RLRec = XLATE('REACTOR_LOG',RLId,'','X') ProbCatIDs = RLRec pcCnt = COUNT(ProbCatIDs,@VM) + (ProbCatIds NE '') FOR I = 1 TO pcCnt ProbCatID = ProbCatIDs<1,I> MaintItemKey = RLId:'*':ProbCatID READ MaintItemRec FROM MaintItemTable,MaintItemKey ELSE MaintItemRec = '' END MaintItemRec = RLRec = ICONV(OCONV(RLRec,'D4/'):' ':OCONV(RLRec,'MT'),'DT') MaintItemRec = RLRec MaintItemRec = RLRec MaintItemREc = RLRec MaintItemRec = RLRec = ICONV(OCONV(RLRec,'D4/'):' ':OCONV(RLRec,'MT'),'DT') *WRITE MaintItemRec ON MaintItemTable,MaintItemKey THEN *END NEXT I RETURN