COMPILE ROUTINE LOAD_PART_REACT(Dummy)
ROWDEF(CHARSTR)

DECLARE SUBROUTINE Send_Dyn,Send_Info, Send_Dyn, Set_Status, RList, ErrMsg, obj_Part
DECLARE FUNCTION Get_Status, Set_Printer

$INSERT RDS_EQU
$INSERT QUOTE_DET_EQU
$INSERT ORDER_DET_EQU
$INSERT QUOTE_EQU
$INSERT PROD_SPEC_EQU
$INSERT PART_EQUATES
$INSERT PART_REACT_EQUATES

$INSERT PART_WORK_EQUATES

EQU TARGET_ACTIVELIST$ to 5


OPEN 'PART' TO PartTable ELSE
	ErrMsg('Unable to open PART')
	GOTO Bail
END	


OPEN 'PART_REACT' TO PartReactTable ELSE
	ErrMsg('Unable to open PART_REACT')
	GOTO Bail
END


SelectSent = 'SELECT PART'

RList(SelectSent,TARGET_ACTIVELIST$, "", "", "")

IF Get_Status(errCode) THEN
	ErrMsg(errCode)
	GOTO Bail
END

DEBUG

RecCnt	= 0
Done	= 0

LOOP
	READNEXT PartNO ELSE Done = 1
UNTIL Done
	READ PartRec FROM PartTable,PartNo THEN
		EpiPartNo = PartRec<PART_EPI_PART_NO$>
		ReactType	= PartRec<PART_REACT_TYPE$>
		
		PartReactKey = EpiPartNo:'*':ReactType
		
		READ PartReact FROM PartReactTable,PartReactKey THEN
			Send_Dyn(PartReactKey:' -> duped')
		END ELSE
			PartReactRec = ''
			PartReactRec<PART_REACT_PROC_STEP_NO$>		= PartRec<PART_PROC_STEP_NO$>
			PartReactRec<PART_REACT_PROC_STEP_PSN$>		= PartRec<PART_PROC_STEP_PSN$>
			PartReactRec<PART_REACT_PROC_STEP_DESC$>	= PartRec<PART_PROC_STEP_DESC$>
			PartReactRec<PART_REACT_SUB_PART_NO$>		= PartRec<PART_SUB_PART_NO$>
			PartReactRec<PART_REACT_SUB_PART_REV$>		= PartRec<PART_SUB_PART_REV$>
			PartReactRec<PART_REACT_SUB_SUPPLIER$>		= PartRec<PART_SUB_SUPPLIER$>
			PartReactRec<PART_REACT_SUB_TYPE$>			= PartRec<PART_SUB_TYPE$>
			PartReactRec<PART_REACT_SUB_COST$> 			= PartRec<PART_SUB_COST$>
			
			WRITE PartReactRec ON PartReactTable,PartReactKey THEN
				Send_Info(PartReactKEy)
			END
		END
		
		RecCnt += 1
		Send_Info(RecCnt)
	END	;* End of OrderDetRec Read
REPEAT






* * * * * * *
Bail:
* * * * * * *

END
