SUBROUTINE PRE_EPI_CLEAN_VALID(ConvType, DataIo, SubrLabel, ReturnedValue)
*
begin condition
pre:
post:
end condition

$insert logical
$insert listbox_config_equ
$insert msg_equates
$INSERT TOOL_CLASS_EQUATES


declare function msg

equ valid$         to 0    ;* successful
equ invalid_msg$   to 1    ;* bad data       -   print error message window
equ invalid_conv$  to 2    ;* bad conversion -          "         "
equ invalid_nomsg$ to 3    ;* bad but do not print the error message window

status() = Valid$

BEGIN CASE
	CASE ConvType = 'ICONV'
	
		IF SubrLabel = 'PRECLEANCASSID' THEN
			ValidChoices = XLATE('LISTBOX_CONFIG','PRECLEANCASSID',1,'X')
		END ELSE
		
			ToolKeys		= XLATE('TOOL_CLASS','AKRION',TOOL_CLASS_TOOL$,'X')
			ToolKeys<1,-1>	= XLATE('TOOL_CLASS','WET BENCH',TOOL_CLASS_TOOL$,'X')

			ValidChoices = ToolKeys
		END
		
		LOCATE DataIo IN ValidChoices USING @VM SETTING Fpos THEN
			ReturnedValue = DataIo
		END ELSE
			MsgInfo = ''
			MsgInfo<mtext$> = DataIo:' is not a valid choice.  Please choose from the Edit Options [SF2].'
			MsgInfo<micon$> = 'H'
			Void = msg( '', MsgInfo )
			status() = invalid_nomsg$
		END
		
	CASE ConvType = 'OCONV'
		ReturnedValue = DataIo
        
	CASE otherwise$
        status() = invalid_msg$
        
END CASE

RETURN
