byifin.idlg

来自「是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到」· IDLG 代码 · 共 202 行

IDLG
202
字号
/*
  sub.idlg -- standard include dialog for by, if, and in options

*! VERSION 1.1.1  10mar2005

    // SCRIPTS and PROGRAMS for external use
	* SCRIPT  byifin_enable
	* SCRIPT  byifin_disable
	* SCRIPT  byifin_disable_by
	* SCRIPT  byifin_disable_if
	* PROGRAM ifin_output
	* PROGRAM by_output

*/

DEFINE fromwd 34
DEFINE fromsep +39
DEFINE towd 15
DEFINE tosep +20

DIALOG sub, tabtitle("by/if/in")
BEGIN
  CHECKBOX ck_by	_lft	_top	_iwd	_ht4,		///
  	groupbox						///
	label("Repeat command by groups")			///
	onclickon(program byifin_by_on)				///
	onclickoff(script byifin_by_off)
  TEXT     tx_by	_indent _ss	_inwd	.,		///
	label("Variables that define groups:")
  VARLIST  vl_by	@	_ss	@	.,		///
	label("Variables that define groups")

  GROUPBOX gb_ifin	_lft	_xls	_iwd	_ht9h,		///
	label("Restrict to observations")

  TEXT     tx_if	_ilft	_ss	_inwd	.,		///
	label("If: (expression)")
  EXP      ex_if	@	_ss	@	.,		///
	label("Create...")

  CHECKBOX ck_in	@	+35	@	.,		///
	label("Use a range of observations")			///
	onclickon(program byifin_in_on)				///
	onclickoff(script byifin_in_off)
  TEXT     tx_from	@	_ss	fromwd	.,		///
  	label("From:") right
  SPINNER  sp_from	fromsep	@	_spwd	.,		///
	min(1) max(c(N)) default(1)
  TEXT     tx_to	_spsep	@	towd	.,		///
	label("to:") right
  SPINNER  sp_to	tosep	@	_spwd	.,		///
  	min(1) max(c(N)) default(c(N))
END

PROGRAM byifin_showmessage
BEGIN
	stopbox note `"On by/if/in tab, "Repeat command by groups" and "Use a range of observations""' ///
	"may not be specified together." ///
	" " "(i.e. the -by- prefix cannot be combined with the -in- qualifier)"
END

///-- For external use
SCRIPT byifin_enable
BEGIN
	program byifin_enable_pr
END

PROGRAM byifin_enable_pr
BEGIN
	call sub.ck_by.enable
	call sub.gb_ifin.enable
	call sub.tx_if.enable
	call sub.ex_if.enable
	call sub.ck_in.enable
	if sub.ck_by {
		call program byifin_by_on
	}
	if sub.ck_in {
		call program byifin_in_on
	}
END

SCRIPT byifin_disable
BEGIN
	sub.ck_by.disable
	sub.tx_by.disable
	sub.vl_by.disable
	sub.gb_ifin.disable
	sub.tx_if.disable
	sub.ex_if.disable
	sub.ck_in.disable
	sub.sp_from.disable
	sub.tx_from.disable
	sub.tx_to.disable
	sub.sp_to.disable
END

SCRIPT byifin_enable_in
BEGIN
	program byifin_enable_in_pr
END

SCRIPT byifin_enable_if
BEGIN
	sub.gb_ifin.enable
	sub.tx_if.enable
	sub.ex_if.enable
END

SCRIPT byifin_disable_by
BEGIN
	sub.ck_by.disable
	sub.tx_by.disable
	sub.vl_by.disable
END

SCRIPT byifin_disable_if
BEGIN
	sub.tx_if.disable
	sub.ex_if.disable
END

PROGRAM ifin_output
BEGIN
	INCLUDE _ifin_pr
END

PROGRAM by_output
BEGIN
	INCLUDE _by_pr
END
///--

PROGRAM byifin_enable_in_pr
BEGIN
	call sub.gb_ifin.enable
	call sub.ck_in.enable
	if sub.ck_in {
		call program byifin_in_on
	}
END

PROGRAM byifin_by_on
BEGIN
	if !H(sub.ck_in) & sub.ck_in {
		call gaction sub.ck_by.setoff
		call program byifin_showmessage
	}
	if !H(sub.ck_in) & !sub.ck_in {
		call sub.vl_by.enable
		call sub.tx_by.enable
	}
END

SCRIPT byifin_by_off
BEGIN
	sub.tx_by.disable
	sub.vl_by.disable
END

PROGRAM byifin_in_on
BEGIN
	if !H(sub.ck_by) & sub.ck_by {
		call sub.ck_in.setoff
		call program byifin_showmessage
	}
	if ! sub.ck_by  | (sub.ck_by & D(sub.ck_by)) {
		call sub.sp_from.enable
		call sub.tx_from.enable
		call sub.tx_to.enable
		call sub.sp_to.enable
	}
END

SCRIPT byifin_in_off
BEGIN
	sub.tx_from.disable
	sub.sp_from.disable
	sub.tx_to.disable
	sub.sp_to.disable
END

///-- left in for backward compatibility
//    NOTE: these calls are deprecated
PROGRAM disable_sub
BEGIN
	call script byifin_disable
END

PROGRAM enable_sub
BEGIN
	call program byifin_enable_pr
END

SCRIPT sub_off
BEGIN
	script byifin_disable
END
///--

/* END:  sub.idlg */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?