/*
  xtset -- set panel variable

*!  VERSION 1.2.3  27may2010

*/

VERSION 11.0

INCLUDE _std_medium
DEFINE _dlght 360
INCLUDE header

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

SCRIPT PREINIT
BEGIN
	create BOOLEAN timeRequired
	create STRING  ARG1
	create STRING  ARG2
	create ARRAY   ARGS
	__MESSAGE.tokenize ARGS
	ARG1.setvalue class ARGS[1]
	ARG2.setvalue class ARGS[2]
	program checkForRequierdTime
	program checkForNote
	create BOOLEAN isMI
	isMI.setfalse
END

SCRIPT POSTINIT
BEGIN
	program check_time_var
END

PROGRAM checkForRequierdTime
BEGIN
	if ARG1.contains("-timeRequired-") {
		call main.ck_t.hide
		call main.tx_t.show
		call main.vn_t.enable
		call timeRequired.settrue
	}
	else {
		call main.ck_t.show
		call main.tx_t.hide
		call timeRequired.setfalse
	}
	call program time_check
END

PROGRAM checkForNote
BEGIN
	if ARG2 {
		call main.tb_note.show
		call main.gb_note.show
		call ARG2.withvalue main.tb_note.setlabel `"@"'
	}
	else {
		call main.tb_note.hide
		call main.gb_note.hide
	}
END

DIALOG main, label("xtset - Declare dataset to be panel data")	///
		tabtitle("Main")
BEGIN

INCLUDE xtset

