/*
	mi expand	

*!  VERSION 1.0.2  03jul2009

*/

VERSION 11.0

INCLUDE _std_small
DEFINE _dlght 130
INCLUDE header
HELP hlp1, view("help mi_expand")
RESET res1

DEFINE ewd  180
DEFINE esep +190

DIALOG main, label("mi expand - Expand mi data") tabtitle("Main")
BEGIN
  TEXT tx_exp		_lft	_top	_iwd	.,			///
	label("Expression:")	
  EXP ex_exp		@	_ss	_iwd	.,			///
	label("Create...")						///
	error("Expression")

  CHECKBOX ck_generate	_lft	_ls	_iwd	.,			///
	option(scores)							///
	onclickon(script main_generate_on)				///
	onclickoff(script main_generate_off)				///
	label("Create variable to mark original dataset observations")
  EDIT ed_generate	_indent2 _ss	_vnwd	.,			///
	max(32) option(generate)					///
	label("Variable name")
  TEXT tx_generate	_vnsep	@	150	.,			///
	label("Variable name") 
END

INCLUDE if

SCRIPT main_generate_on
BEGIN
	main.ed_generate.enable
	main.tx_generate.enable
END

SCRIPT main_generate_off
BEGIN
	main.ed_generate.disable
	main.tx_generate.disable
END

PROGRAM command
BEGIN
	put "mi expand "
	require main.ex_exp
	put " " main.ex_exp " "
	INCLUDE _if_pr
	beginoptions
		if (main.ck_generate) {
			require main.ed_generate
			optionarg main.ed_generate
		}
	endoptions
END
