/*

  mi passive: replace

*!  VERSION 1.0.2  03jul2009

*/

VERSION 11.0

INCLUDE _std_medium
INCLUDE header
HELP hlp1, view("help mi passive")
RESET res1

DIALOG main, tabtitle("Main")				///
	label("mi passive: replace - Replace and register passive variables")
	
BEGIN
  TEXT     tx_dv	_lft	_top	_iwd	.,	///
	label("Variable:")
  VARNAME  vn_old	@	_ss	_vnwd	.,	///
	label("Variable")

  TEXT     tx_exp	_lft	_ls	_iwd	.,	///
	label("New contents: (value or expression)")
  EXP      ex_exp	_lft	_ss	_iwd	.,	///
	label("Create ...") error("New contents")
  CHECKBOX ck_type	_lft	+35	_iwd	.,	///
	option(nopromote) label("Preserve type ")
END

INCLUDE byif

PROGRAM my_by_output
BEGIN
	if sub.ck_by {
		require sub.vl_by
		put "by  " sub.vl_by ":"
	}
END

PROGRAM command
BEGIN
	put "mi passive: "
	put /program my_by_output " "
        put "replace "
        varlist main.vn_old
        put "= "
        require main.ex_exp
        put main.ex_exp
        put " " /program if_output
	beginoptions
                option main.ck_type
        endoptions
END
