COMPILE ROUTINE Import_Tool_Data(Dummy)
ROWDEF(CHARSTR)

DECLARE SUBROUTINE RList,Send_Dyn
DECLARE FUNCTION Get_Status

$INSERT TOOL_EQUATES
$INSERT TOOL_CLASS_EQUATES
$INSERT TOOL_STAGE_EQUATES

EQU COL_PRE_AKRION_RECIPE$			TO 1
EQU COL_POST_AKRION_RECIPE$			TO 2
EQU COL_POST_CLEAN_SURFSCAN_RECIPE$	TO 3
EQU COL_SRP_RECIPE$					TO 4
EQU COL_CRES_MEASURE_ALL$			TO 5
EQU COL_4PP_RECIPE$					TO 6
EQU COL_4PP_PATTERN$				TO 7
EQU COL_FTIR_RECIPE$				TO 8
EQU COL_FTIR_PATTERN$				TO 9
EQU COL_TW_MEAS_TYPE_ALL$			TO 10




OPEN 'TOOL_CLASS' TO fhToolClass ELSE
	DEBUG
	GOTO Bail
END

OPEN 'TOOL_STAGE' TO fhToolStage ELSE
	DEBUG
	GOTO Bail
END	


DosFile = 'C:\OIReports\Tool_Prop_Data.txt'
FileSize = Dir(DosFile)<1>

OSOPEN DosFile TO FileIn ELSE
	debug
	GOTO Bail
END

OffSet = 0

OSClose FileIn

OSBRead RawData FROM FileIn AT OffSet LENGTH FileSize

SWAP CHAR(13):CHAR(10) WITH @FM IN RawData
SWAP CHAR(09) WITH @VM IN RawData

DEBUG

Result = ''

	
	* TOOL_STAGES 
	
	
	LineCnt = COUNT(RawData,@FM) + (RawData NE '')
	
	AkrionPreRecipes = ''
	AkrionPostRecipes = ''
	SurfscanPostRecipes = ''
	SrpRecipes = ''
	HgCvRecipes = ''
	FourPPRecipes = ''
	FourPPPatterns = ''
	FTIRRecipes = ''
	FTIRPatterns = ''
	
	FOR N = 2 TO LineCnt
		IF RawData<N,COL_PRE_AKRION_RECIPE$> NE ''			THEN AkrionPreRecipes<1,-1> 	= RawData<N,COL_PRE_AKRION_RECIPE$>
		IF RawData<N,COL_POST_AKRION_RECIPE$> NE '' 		THEN AkrionPostRecipes<1,-1>	= RawData<N,COL_POST_AKRION_RECIPE$>
		IF RawData<N,COL_POST_CLEAN_SURFSCAN_RECIPE$> NE ''	THEN SurfscanPostRecipes<1,-1>	= RawData<N,COL_POST_CLEAN_SURFSCAN_RECIPE$>
		IF RawData<N,COL_SRP_RECIPE$> NE '' 				THEN SRPRecipes<1,-1>			= RawData<N,COL_SRP_RECIPE$>
		IF RawData<N,COL_CRES_MEASURE_ALL$> NE '' 			THEN HgCvRecipes<1,-1>			= RawData<N,COL_CRES_MEASURE_ALL$>
		IF RawData<N,COL_4PP_RECIPE$> NE '' 				THEN FourPPRecipes<1,-1>		= RawData<N,COL_4PP_RECIPE$>
		IF RawData<N,COL_4PP_PATTERN$> NE '' 				THEN FourPPPatterns<1,-1>		= RawData<N,COL_4PP_PATTERN$>
		IF RawData<N,COL_FTIR_RECIPE$> NE '' 				THEN FTIRRecipes<1,-1>			= RawData<N,COL_FTIR_RECIPE$>
		IF RawData<N,COL_FTIR_PATTERN$> NE '' 				THEN FTIRPatterns<1,-1>			= RawData<N,COL_FTIR_PATTERN$>
	NEXT N
	
	
	ToolStageKey = 'AKRION*PRE'
	ToolStageRec = AkrionPreRecipes
	
	WRITE ToolStageRec ON fhToolStage,ToolStageKey THEN
		Send_Dyn('PreAkrion Recipes')
	END
	
	ToolStageKey = 'AKRION*POST'
	ToolStageRec = AkrionPostRecipes
	
	WRITE ToolStageRec ON fhToolStage,ToolStageKey THEN
		Send_Dyn('PostAkrion Recipes')
	END
	
	ToolStageKey = 'TENCOR*POST'
	ToolStageRec = SurfscanPostRecipes
	
	WRITE ToolStageRec ON fhToolStage,ToolStageKey THEN
		Send_Dyn('PostTencor Recipes')
	END
	
	ToolClassKey = 'SRP'
	READ ToolClassRec FROM fhToolClass,ToolClassKey ELSE ToolClassRec = ''
	
	ToolClassRec<TOOL_CLASS_RECIPES$> = SRPRecipes
	
	WRITE ToolClassRec ON fhToolClass,ToolClassKey THEN
		Send_Dyn('Tool Class "SRP"')
	END
	
	ToolClassKey = 'HGCV'
	READ ToolClassRec FROM fhToolClass,ToolClassKey ELSE ToolClassRec = ''
	
	ToolClassRec<TOOL_CLASS_RECIPES$> = HgCvRecipes
	
	WRITE ToolClassRec ON fhToolClass,ToolClassKey THEN
		Send_Dyn('Tool Class "HgCv"')
	END
	
	ToolClassKey = '4PP'
	READ ToolClassRec FROM fhToolClass,ToolClassKey ELSE ToolClassRec = ''
	
	ToolClassRec<TOOL_CLASS_RECIPES$> = FourPPRecipes
	ToolClassRec<TOOL_CLASS_PATTERN$> = FourPPPatterns
	
	WRITE ToolClassRec ON fhToolClass,ToolClassKey THEN
		Send_Dyn('Tool Class "4PP"')
	END
	
	ToolClassKey = 'FTIR'
	READ ToolClassRec FROM fhToolClass,ToolClassKey ELSE ToolClassRec = ''
	
	ToolClassRec<TOOL_CLASS_RECIPES$> = FTIRRecipes
	ToolClassRec<TOOL_CLASS_PATTERN$> = FTIRPatterns
	
	WRITE ToolClassRec ON fhToolClass,ToolClassKey THEN
		Send_Dyn('Tool Class "FTIR"')
	END
	
	
	DEBUG
	
	

GOTO Bail


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


END
