/*
    mi_replace0

*!  VERSION 1.0.0  29may2009

*/

VERSION 11.0

INCLUDE _std_medium
DEFINE _dlght 120
INCLUDE header
HELP hlp1, view("help mi_replace0")
RESET res1

DIALOG main,label("mi replace0 - Replace original data")  tabtitle("Main")
BEGIN
  TEXT tx_using		_lft	_top	_iwd	.,			///
	label("Filename of dataset on disk:")
  FILE fi_filename	@	_ss	@	.,			///
	filter("Stata Dataset (*.dta)|*.dta|All (*.*)|*.*")		///
	defext(dta)							///
	error("Filename of dataset on disk")				///
	label("Browse...")

  TEXT tx_id		@	_ls	@	.,			///
	label("Variables to match observations on:")
  VARLIST vl_id		@	_ss	@	.,			///
	option(id)					 		///
	label("Variables to match observations on")
END

PROGRAM command
BEGIN
	if !main.fi_filename {
		stopbox stop `"On the "Main" tab,"'     ///
			`"A dataset on disk must be selected""'
	}
	put "mi replace0 using "
	if main.fi_filename {
		put `"""'
		put main.fi_filename
		put `"""' " "
	}

	beginoptions
		require main.vl_id
		optionarg main.vl_id
	endoptions
END
