/*
  sample

*! VERSION 1.0.1  27aug2003

*/

VERSION 8.0

INCLUDE _std_medium
INCLUDE header

HELP hlp1, view("help sample")
RESET res1

DIALOG main, label("sample - Draw random sample") tabtitle("Main")
BEGIN
  /*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+*/ 
  
  RADIO    rb_percent     _lft      _top      _rbwd     .,		/*
		*/ label("")						/*
		*/ clickon("script percent")				/*
		*/ first						/*
		*/ option("NONE")					/*
		*/
  EDIT     en_percent     _rbsep    @         _en7wd    .,		/*
		*/ label("Percentage of current data to sample")	/*
		*/ numonly						/*
		*/
  TEXT     tx_percent     _en7sep   @         _rben7r    .,		/*
		*/ label("Percentage of current data to sample")	/*
		*/

  RADIO    rb_count  _lft      _ls       _rbwd     .,			/*
		*/ label("")						/*
		*/ clickon("script count")				/*
		*/ last							/*
		*/ option("count")					/*
		*/
  SPINNER  sp_count  _rbsep    @         _spwd     .,			/*
		*/ label("Sample size")					/*
		*/ min(1)						/*
		*/ max(c(N))						/*
		*/ default(c(N))					/*
		*/ option("size")					/*
		*/
  TEXT     tx_count  _spsep    @         _rbspr    .,			/*
		*/ label("Sample size")					/*
		*/

END


SCRIPT percent
BEGIN
	main.en_percent.enable
	main.sp_count.disable
END

SCRIPT count
BEGIN
	main.en_percent.disable
	main.sp_count.enable
END

INCLUDE byifin

PROGRAM command
BEGIN
	INCLUDE _by_pr
	put "sample "
	if main.rb_percent{
		require  main.en_percent
		put main.en_percent
	}
	if main.rb_count {
		put main.sp_count
	}
	INCLUDE _ifin_pr
	beginoptions
		option radio(main rb_percent rb_count)
	endoptions
END

