/*
    gr_tw_plot.dlg

*!  VERSION 1.1.2  17jun2011

*/

VERSION 10.0

INCLUDE _std_wide
DEFINE _dlght 350
INCLUDE header_gr_child

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

SCRIPT main_PREINIT
BEGIN
	create STRING basicMarkerResults
	create STRING basicLineResults
	create STRING basicAreaResults
	create STRING basicBarResults
	create STRING basicSpikeResults
	
	create STRING rangeAreaResults
	create STRING rangeBarResults
	create STRING rangeSpikeResults
	create STRING rangeMarkerResults
	create STRING rangeLineResults
	
	create STRING ContourResults
	create STRING ContourLineResults
	
	create STRING fitLFitResults
	create STRING fitQFitResults
	create STRING fitFPFitResults
	create STRING fitLFitCiResults
	create STRING fitQFitCiResults
	create STRING fitFPFitCiResults
	
	create LIST   im_sci_coord_list
	create LIST   im_sci_coord_values
	create LIST   im_pci_coord_list
	create LIST   im_pci_coord_values
	create DOUBLE im_sci_counter
	create DOUBLE im_pci_counter
	
	create STRING imSci1
	create STRING imSci2
	create STRING imSci3
	create STRING imSci4
	create STRING imSci5
	create STRING imSci6
	create STRING imSci7
	create STRING imSci8
	create STRING imSci9
	create STRING imSci10
	create STRING imSci11
	create STRING imSci12
	create STRING imSci13
	create STRING imSci14
	create STRING imSci15
	create STRING imSci16
	create STRING imSci17
	create STRING imSci18
	create STRING imSci19
	create STRING imSci20
	create STRING imSci21
	create STRING imSci22
	create STRING imSci23
	create STRING imSci24
	create STRING imSci25
	create STRING imSci26
	create STRING imSci27
	create STRING imSci28
	create STRING imSci29
	create STRING imSci30
	create STRING imSci31
	create STRING imSci32
	
	create BOOLEAN imSciDeleted1
	create BOOLEAN imSciDeleted2
	create BOOLEAN imSciDeleted3
	create BOOLEAN imSciDeleted4
	create BOOLEAN imSciDeleted5
	create BOOLEAN imSciDeleted6
	create BOOLEAN imSciDeleted7
	create BOOLEAN imSciDeleted8
	create BOOLEAN imSciDeleted9
	create BOOLEAN imSciDeleted10
	create BOOLEAN imSciDeleted11
	create BOOLEAN imSciDeleted12
	create BOOLEAN imSciDeleted13
	create BOOLEAN imSciDeleted14
	create BOOLEAN imSciDeleted15
	create BOOLEAN imSciDeleted16
	create BOOLEAN imSciDeleted17
	create BOOLEAN imSciDeleted18
	create BOOLEAN imSciDeleted19
	create BOOLEAN imSciDeleted20
	create BOOLEAN imSciDeleted21
	create BOOLEAN imSciDeleted22
	create BOOLEAN imSciDeleted23
	create BOOLEAN imSciDeleted24
	create BOOLEAN imSciDeleted25
	create BOOLEAN imSciDeleted26
	create BOOLEAN imSciDeleted27
	create BOOLEAN imSciDeleted28
	create BOOLEAN imSciDeleted29
	create BOOLEAN imSciDeleted30
	create BOOLEAN imSciDeleted31
	create BOOLEAN imSciDeleted32
	
	create STRING imPci1
	create STRING imPci2
	create STRING imPci3
	create STRING imPci4
	create STRING imPci5
	create STRING imPci6
	create STRING imPci7
	create STRING imPci8
	create STRING imPci9
	create STRING imPci10
	create STRING imPci11
	create STRING imPci12
	create STRING imPci13
	create STRING imPci14
	create STRING imPci15
	create STRING imPci16
	create STRING imPci17
	create STRING imPci18
	create STRING imPci19
	create STRING imPci20
	create STRING imPci21
	create STRING imPci22
	create STRING imPci23
	create STRING imPci24
	create STRING imPci25
	create STRING imPci26
	create STRING imPci27
	create STRING imPci28
	create STRING imPci29
	create STRING imPci30
	create STRING imPci31
	create STRING imPci32
	
	create BOOLEAN imPciDeleted1
	create BOOLEAN imPciDeleted2
	create BOOLEAN imPciDeleted3
	create BOOLEAN imPciDeleted4
	create BOOLEAN imPciDeleted5
	create BOOLEAN imPciDeleted6
	create BOOLEAN imPciDeleted7
	create BOOLEAN imPciDeleted8
	create BOOLEAN imPciDeleted9
	create BOOLEAN imPciDeleted10
	create BOOLEAN imPciDeleted11
	create BOOLEAN imPciDeleted12
	create BOOLEAN imPciDeleted13
	create BOOLEAN imPciDeleted14
	create BOOLEAN imPciDeleted15
	create BOOLEAN imPciDeleted16
	create BOOLEAN imPciDeleted17
	create BOOLEAN imPciDeleted18
	create BOOLEAN imPciDeleted19
	create BOOLEAN imPciDeleted20
	create BOOLEAN imPciDeleted21
	create BOOLEAN imPciDeleted22
	create BOOLEAN imPciDeleted23
	create BOOLEAN imPciDeleted24
	create BOOLEAN imPciDeleted25
	create BOOLEAN imPciDeleted26
	create BOOLEAN imPciDeleted27
	create BOOLEAN imPciDeleted28
	create BOOLEAN imPciDeleted29
	create BOOLEAN imPciDeleted30
	create BOOLEAN imPciDeleted31
	create BOOLEAN imPciDeleted32
	
	create STRING imSciResult
	create STRING imPciResult
	create STRING imMarkerResults
	create STRING imLineResults
	create STRING imSpikeResults
	create STRING imArrowResults
	create STRING imPcMarkerResults
	create STRING immediateRecast
	
	main.bu_im_delete.disable
	main.bu_im_edit.disable
	
	create STRING advTslineResults
	create STRING advMbandResults
	create STRING advLowessResults
	create STRING advLowessLineResults
	create STRING advKdensityResults
	create STRING advKdensityLineResults
	create STRING advHistogramResults
	create STRING advHistogramBarResults
	create STRING advLocpolyResults
	create STRING advLocpolyCiResults
	create STRING advFunctionLineResults
	create STRING advFunctionResults
	create STRING advPcLineResults
	create STRING advPcMarkerResults
	create STRING advPcArrowResults
	
	create STRING basicMarkerWeights
	create STRING rangeMarkerWeights
	create STRING fitWeights
	create STRING advWeights
	create PBOOLEAN y2Hidden
END

SCRIPT main_POSTINIT
BEGIN
	program checkBasicWeights
	program checkBasicMarkerResults
	program checkBasicLineResults
	program checkBasicAreaResults
	program checkBasicBarResults
	program checkBasicSpikeResults
	
	program checkRangeWeights
	program checkRangeAreaResults
	program checkRangeBarResults
	program checkRangeSpikeResults
	program checkRangeMarkerResults
	program checkRangeLineResults

	program checkContourResults
	program checkContourLineResults
	program checkContourLine_LineResults

	program checkFitWeights
	program checkFitLFitResults
	program checkFitQFitResults
	program checkFitFPFitResults
	program checkFitLFitCiResults
	program checkFitQFitCiResults
	program checkFitFPFitCiResults
	
	program checkImMarkerResults
	program checkImLineResults
	program checkImSpikeResults
	program checkImArrowResults
	program checkImPcMarkerResults
	
	program checkAdvWeights
	program checkAdvTslineResults
	program checkAdvMbandResults
	program checkAdvLowessResults
	program checkAdvLowessLineResults
	program checkAdvKdensityResults
	program checkAdvKdensityLineResults
	program checkAdvHistogramResults
	program checkAdvHistogramBarResults
	program checkAdvLocpolyResults
	program checkAdvLocpolyCiResults
	program checkAdvFunctionResults
	program checkAdvFunctionLineResults
	program checkAdvPcLineResults
	program checkAdvPcMarkerResults
	program checkAdvPcArrowResults
END

/* To be called from the parent dialog box...
 */
SCRIPT y2SetHidden_true
BEGIN
	y2Hidden.settrue
	main.ck_basic_y2.hide
	program main_check_category
END

DIALOG main, title("Define new twoway plot") tabtitle("Plot")
BEGIN
  GROUPBOX gb_plot_category	_lft	_top	_iwd	_ht11h,	///
	label("Choose a plot category and type")
  RADIO    rb_basic		_ilft	_ss	200	.,	///
	first							///
	label("Basic plots")					///
	onclickon(program main_check_category)
  DEFINE y @y
  RADIO    rb_range		@	_ss	@	.,	///
	label("Range plots")					///
	onclickon(program main_check_category)
  RADIO    rb_contour		@	_ss	@	.,	///
	label("Contour plots")					///
	onclickon(program main_check_category)
  RADIO    rb_fit		@	_ss	@	.,	///
	label("Fit plots")					///
	onclickon(program main_check_category)
  RADIO	   rb_immediate		@	_ss	@	.,	///
	label("Immediate plots")				///
	onclickon(program main_check_category)
  RADIO    rb_advanced		@	_ss	@	.,	///
	last							///
	label("Advanced plots")					///
	onclickon(program main_check_category)
	
  TEXT     tx_category		+220	y	220	.,
  LISTBOX  lb_type_basic	@	+18	180	82,	///
	contents(plot_type_basic) 				///
	values(plot_type_basic_values)				///
	onselchangelist(plot_type_basic_sel)
  LISTBOX  lb_type_range	@	@	180	@,	///
	contents(plot_type_range)				///
	values(plot_type_range_values)				///
	onselchangelist(plot_type_range_sel)
  LISTBOX  lb_type_contour	@	@	180	@,	///
	contents(plot_type_contour)				///
	values(plot_type_contour_values)			///
	onselchangelist(plot_type_contour_sel)
  LISTBOX  lb_type_fit		@	@	180	@,	///
	contents(plot_type_fit)					///
	values(plot_type_fit_values)				///
	onselchangelist(plot_type_fit_sel)
  LISTBOX  lb_type_immediate	@	@	240	@,	///
	contents(plot_type_immediate)				///
	values(plot_type_immediate_values)			///
	onselchangelist(plot_type_immediate_sel)
  LISTBOX  lb_type_advanced	@	@	240	@,	///
	contents(plot_type_advanced)				///
	values(plot_type_advanced_values)			///
	onselchangelist(plot_type_advanced_sel)
	
  GROUPBOX gb_plot		_lft	170	_iwd	_ht13,	///
	label("Selected plot to be substituted here")

//** Basic plot controls **//	
  TEXT     tx_basic_yvar	_ilft	_ss	_vnwd	.,	///
	label("Y variable:")
  DEFINE y @y
  DEFINE vartop @y
  VARNAME  vn_basic_yvar	@	_ss	@	.,	///
	label("Y variable")
	
  TEXT     tx_basic_xvar	+145	y	_vnwd	.,	///
	label("X variable:")
  VARNAME  vn_basic_xvar	@	_ss	@	.,	///
	label("X variable")
  CHECKBOX ck_basic_sortx	+145	@	150	.,	///
	label("Sort on x variable") option(sort)
  CHECKBOX ck_basic_y2		_ilft	_ls	_ibwd	.,	///
	label("Add a second y axis on right")			///
	option(yaxis(2))
 
  BUTTON   bu_basic_weight	_ilft	+30	120	.,	///
	label("Marker weights  ")				///
	onpush(script show_basic_weight_dialog)			///
	tooltip("Weight markers based on a variable") 
  BUTTON   bu_basic_scatter	_ilft	@	120	.,	///
	label("Marker properties")				///
	onpush(script show_basic_marker_dialog)			///
	tooltip("Marker symbol and label properties")
  BUTTON   bu_basic_line	_ilft	@	120	.,	///
	label("Line properties  ")				///
	onpush(script show_basic_line_dialog)
  BUTTON   bu_basic_area	_ilft	@	120	.,	///
	label("Area properties  ")				///
	onpush(script show_basic_area_dialog)
  BUTTON   bu_basic_bar		_ilft	@	120	.,	///
	label("Bar properties  ")				///
	onpush(script show_basic_bar_dialog)
  BUTTON   bu_basic_spike	_ilft	@	120	.,	///
	label("Spike properties  ")				///
	onpush(script show_basic_spike_dialog)
//-- end basic plot controls --//

//** Range plot controls **//
  TEXT     tx_range_yvar1	_ilft	vartop	_vnwd	.,	///
	label("Y1 variable:")
  DEFINE y @y
  VARNAME  vn_range_yvar1	@	_ss	@	.,	///
	label("Y1 variable:")
	
  TEXT     tx_range_xvar	+145	y	_vnwd	.,	///
	label("X variable:")
  VARNAME  vn_range_xvar	@	_ss	@	.,	///
	label("X variable")

  CHECKBOX ck_range_sortx	+145	@	150	.,	///
	label("Sort on x variable") option(sort)
	
  TEXT     tx_range_yvar2	_ilft	_ls	_vnwd	.,	///
	label("Y2 variable:")
  DEFINE y @y
  VARNAME  vn_range_yvar2	@	_ss	@	.,	///
	label("Y2 variable:")

  CHECKBOX ck_range_y2		+145	@	_cwd3	.,	///
	label("Add a second y axis on right")			///
	option(yaxis(2))

  COMBOBOX cb_range_cap_size	@	+35	100	.,	///
	dropdown 						///
	contents(symbolsizes) option(msize)
  TEXT     tx_range_cap_size	+105	@	120	.,	///
	label("Cap size")
  BUTTON   bu_range_weight	_ilft	@	120	.,	///
	label("Marker weights  ")				///
	onpush(script show_range_weight_dialog)			///
	tooltip("Weight markers based on a variable") 
  BUTTON   bu_range_area	_ilft	@	120	.,	///
	label("Area properties  ")				///
	onpush(script show_range_area_dialog)
  BUTTON   bu_range_bar		_ilft	@	120	.,	///
	label("Bar properties  ")				///
	onpush(script show_range_bar_dialog)
  BUTTON   bu_range_spike	_ilft	@	120	.,	///
	label("Spike properties  ")				///
	onpush(script show_range_spike_dialog)
  BUTTON   bu_range_scatter	_ilft	@	120	.,	///
	label("Marker properties  ")				///
	onpush(script show_range_marker_dialog)			///
	tooltip("Marker symbol and label properties")
  BUTTON   bu_range_line	_ilft	@	120	.,	///
	label("Line properties  ")				///
	onpush(script show_range_line_dialog)
//-- end range plot controls --//
  
//** Contour plot controls **//
  TEXT     tx_con_zvar		_ilft	vartop	_vnwd	.,	///
	label("Z variable:")
  DEFINE y @y
  VARNAME  vn_con_zvar		@	_ss	@	.,	///
	label("Z variable")
  TEXT     tx_con_yvar		165	y	_vnwd	.,	///
	label("Y variable:")
  VARNAME  vn_con_yvar		@	_ss	@	.,	///
	label("Y variable")
  TEXT     tx_con_xvar		+145	y	_vnwd	.,	///
	label("X variable:")
  VARNAME  vn_con_xvar		@	_ss	@	.,	///
	label("X variable")

  BUTTON   bu_contour		_ilft	_ls	120	.,	///
	label("Contour properties  ")				///
	onpush(program show_contour_dialog)
  BUTTON   bu_contourline	@	@	120	.,	///
	label("Contour properties  ")				///
	onpush(program show_contourline_dialog)
  
  CHECKBOX ck_con_y2		+145	@	_cwd3	.,	///
	label("Add a second y axis on right")			///
	option(yaxis(2))
//-- end contour plot controls --//

//** Fit plot controls **//
  TEXT     tx_fit_yvar		_ilft	vartop	_vnwd	.,	///
	label("Y variable:")
  DEFINE y @y
  VARNAME  vn_fit_yvar		@	_ss	@	.,	///
	label("Y variable")
	
  TEXT     tx_fit_xvar		+145	y	_vnwd	.,	///
	label("X variable:")
  VARNAME  vn_fit_xvar		@	_ss	@	.,	///
	label("X variable")
  BUTTON   bu_fit_weight	+145	@	100	.,	///
	label("Weights ")					///
	onpush(script show_fit_weight_dialog)			///
	tooltip("Frequency weights, sampling weights, or analytic weights")
  CHECKBOX ck_fit_y2		_ilft	_ls	_ibwd	.,	///
	label("Add a second y axis on right")			///
	option(yaxis(2))

  BUTTON   bu_fit_lfit		_ilft	+35	120	.,	///
	label("Options  ")					///
	onpush(script show_fit_lfit_dialog)			///
	tooltip("Options that affect the linear prediction plot")
  BUTTON   bu_fit_qfit		@	@	@	.,	///
	label("Options  ")					///
	onpush(script show_fit_qfit_dialog)			///
	tooltip("Options that affect quadratic prediction plot")
  BUTTON   bu_fit_fpfit		@	@	@	.,	///
	label("Options  ")					///
	onpush(script show_fit_fpfit_dialog)			///
	tooltip("Options that affect fractional polynomial plot")
  BUTTON   bu_fit_lfitci	@	@	@	.,	///
	label("Options  ")					///
	onpush(script show_fit_lfitci_dialog)			///
	tooltip("Options that affect linear prediction plot and confidence intervals")	
  BUTTON   bu_fit_qfitci	@	@	@	.,	///
	label("Options  ")					///
	onpush(script show_fit_qfitci_dialog)			///
	tooltip("Options that affect quadratic prediction plot and confidence intervals")
  BUTTON   bu_fit_fpfitci	@	@	@	.,	///
	label("Options  ")					///
	onpush(script show_fit_fpfitci_dialog)			///
	tooltip("Options that affect fractional polynomial plot and confidence intervals")
//-- end fit plot controls --//

//** Immediate plot controls **//
  TEXT     tx_im_coord		_ilft	vartop	210	.,	///
	label("Coordinates:")
  LISTBOX  lb_im_sci_coord	@	_ss	@	105,	///
	label("Coordinates") 					///
	contents(im_sci_coord_list)				///
	values(im_sci_coord_values)				///
	ondblclick(program im_check_edit)
  LISTBOX  lb_im_pci_coord	@	@	@	105,	///
	label("Coordinates") 					///
	contents(im_pci_coord_list)				///
	values(im_pci_coord_values)				///
	ondblclick(program im_check_edit)
  DEFINE y @y
  BUTTON   bu_im_define		+220	@	70	.,	///
	label("Add...")						///
	onpush(program im_create)				///
	tooltip("Click to add a new coordinate")
  BUTTON   bu_im_edit		@	_ms	@	.,	///
	label("Edit")						///
	onpush(program im_check_edit)				///
	tooltip("Click to edit the selected coordinate")
  BUTTON   bu_im_delete		@	_ms	@	.,	///
	label("Delete")						///
	onpush(program im_check_delete)				///
	tooltip("Click to delete the selected coordinate")
	
  BUTTON   bu_im_marker		@	+35	_vnwd	.,	///
	label("Marker properties  ")				///
	onpush(script show_im_marker_dialog)			///
	tooltip("Marker symbol and label properties")
  BUTTON   bu_im_line		@	@	_vnwd	.,	///
	label("Line properties  ")				///
	onpush(script show_im_line_dialog)
  BUTTON   bu_im_pcspike	@	@	_vnwd	.,	///
	label("Line properties  ")				///
	onpush(script show_im_pcspike_dialog)
  BUTTON   bu_im_pcarrow	+140	@	150	.,	///
	label("Arrowhead properties  ")				///
	onpush(script show_im_pcarrow_dialog)
  BUTTON   bu_im_pcmarker	@	@	_vnwd	.,	///
	label("Marker properties  ")				///
	onpush(script show_im_pcmarker_dialog)			///
	tooltip("Marker symbol and label properties")
	
  CHECKBOX ck_im_y2		@	y	190	.,	///
	label("Add a second y axis on right")			///
	option(yaxis(2))

//-- end immediate plot controls --//

//** Advanced plot controls **//
  TEXT     tx_adv_zvar		_ilft	vartop	_vnwd	.,	///
	label("Z variable:")
  DEFINE y @y
  VARNAME  vn_adv_zvar		@	_ss	@	.,	///
	label("Z variable")

  TEXT     tx_adv_yvar		_ilft	y	_vnwd	.,	///
	label("Y variable:")
  VARNAME  vn_adv_yvar		@	_ss	@	.,	///
	label("Y variable")

  TEXT     tx_adv_function	_ilft	y	320	.,	///
	label("Function:")
  EXP	   ex_adv_function	@	_ss	@	.,	///
	label("Create...") error("Function")
  TEXT     tx_adv_function_range +340	y	120	.,	///
	label("Range:")
  VARNAME  vn_adv_function_range @	_ss	@	.,	///
	label("Range:")						///
	option(range)
  TEXT     tx_adv_xvar		165	y	_vnwd	.,	///
	label("X variable:")
  VARNAME  vn_adv_xvar		@	_ss	@	.,	///
	label("X variable")

  BUTTON   bu_adv_weight	@	@	100	.,	///
	label("Weights  ")					///
	onpush(program show_adv_weight_dialog)

  TEXT     tx_adv_yvar2		_ilft	_ls	_vnwd	.,	///
	label("Y2 variable:")
  DEFINE y2 @y
  VARNAME  vn_adv_yvar2		@	_ss	@	.,	///
	label("Y2 variable:")
	
  TEXT     tx_adv_xvar2		+145	y2	_vnwd	.,	///
	label("X2 variable:")
  VARNAME  vn_adv_xvar2		@	_ss	@	.,	///
	label("X2 variable")

  CHECKBOX ck_adv_y2		+145	@	_cwd3	.,	///
	label("Add a second y axis on right")			///
	option(yaxis(2))

  CHECKBOX ck_adv_bands		@	y	_cwd3	.,	///
	label("Set the number of bands")			///
	onclickoff(main.sp_adv_bands.disable) 			///
	onclickon(main.sp_adv_bands.enable)
  DEFINE x @x
  SPINNER  sp_adv_bands		+20	_ss	_spwd	.,	///
	default(10) min(1) max(10000000) option(bands)

  CHECKBOX ck_adv_n		x	_ls	_cwd3	.,	///
	label("Set number of points between knots")		///
	onclickoff(main.sp_adv_n.disable) 			///
	onclickon(main.sp_adv_n.enable)
  SPINNER  sp_adv_n		+20	_ss	_spwd	.,	///
	default(10) min(1) max(10000000) option(n)
	
  BUTTON   bu_adv_tsline	_ilft	@	120	.,	///
	label("Line properties  ")				///
	onpush(script show_adv_tsline_dialog)

  BUTTON   bu_adv_mband		_ilft	@	120	.,	///
	label("Line properties  ")				///
	onpush(script show_adv_mband_dialog)
	
  BUTTON   bu_adv_lowess	_ilft	@	120	.,	///
	label("Lowess options  ")				///
	onpush(script show_adv_lowess_dialog)
  BUTTON   bu_adv_kdensity	_ilft	@	130	.,	///
	label("Kernel options  ")				///
	onpush(script show_adv_kdensity_dialog)
  BUTTON   bu_adv_histogram	_ilft	@	130	.,	///
	label("Histogram options  ")				///
	onpush(program show_adv_histogram_dialog)
  BUTTON   bu_adv_locpoly	_ilft	@	120	.,	///
	label("Options  ")					///
	onpush(script show_adv_locpoly_dialog)
  BUTTON   bu_adv_locpolyci	_ilft	@	120	.,	///
	label("Options  ")					///
	onpush(script show_adv_locpolyci_dialog)
  BUTTON   bu_adv_function	@	@	120	.,	///
	label("Advanced  ")					///
	onpush(script show_adv_function_dialog)
  BUTTON   bu_adv_lowess_line	+145	@	120	.,	///
	label("Line properties  ")				///
	onpush(script show_adv_lowess_line_dialog)
  BUTTON   bu_adv_kdensity_line	@	@	120	.,	///
	label("Line properties  ")				///
	onpush(script show_adv_kdensity_line_dialog)
  BUTTON   bu_adv_histogram_bar @	@	120	.,	///
	label("Bar properties  ")				///
	onpush(script show_adv_histogram_bar_dialog)
  BUTTON   bu_adv_function_line	@	@	120	.,	///
	label("Line properties  ")				///
	onpush(script show_adv_function_line_dialog)
  BUTTON   bu_adv_pcline	_ilft	+35	120	.,	///
	label("Line properties  ")				///
	onpush(script show_adv_pcline_dialog)
  BUTTON   bu_adv_pcmarker	+145	@	120	.,	///
	label("Marker properties  ")				///
	onpush(script show_adv_pcmarker_dialog)			///
	tooltip("Marker symbol and label properties")
  BUTTON   bu_adv_pcarrow	@	@	150	.,	///
	label("Arrowhead properties  ")				///
	onpush(script show_adv_pcarrow_dialog)

  GROUPBOX gb_adv_hist_data	_lft2	vartop	_cwd2	_ht4,	///
	label("Type of data")
  RADIO	   rb_adv_hist_cont 	_indent	_ss	_inwd	.,	///
	first							///
	onclickon(script continuous_on)				///
	label("Continuous data")
  RADIO    rb_adv_hist_discrete	@	_ss	@	.,	///
	last							///
	onclickon(script discrete_on)				///
	label("Discrete data") option(discrete)
//-- end of advanced plot controls **//
END

PROGRAM main_check_category
BEGIN
	if main.rb_basic {
		call main.lb_type_basic.show
		call main.lb_type_fit.hide
		call main.lb_type_range.hide
		call main.lb_type_contour.hide
		call main.lb_type_immediate.hide
		call main.lb_type_advanced.hide
		call main.tx_category.setlabel "Basic plots: (select type)"
		call main.lb_type_basic.withvalue main.lb_type_basic.setvalue "@"
		call script ifin_enable
	}
	if main.rb_range {
		call main.lb_type_basic.hide
		call main.lb_type_fit.hide
		call main.lb_type_range.show
		call main.lb_type_contour.hide
		call main.lb_type_immediate.hide
		call main.lb_type_advanced.hide
		call main.tx_category.setlabel "Range plots: (select type)"
		call main.lb_type_range.withvalue main.lb_type_range.setvalue "@"
		call script ifin_enable
	}
	if main.rb_contour {
		call main.lb_type_basic.hide
		call main.lb_type_fit.hide
		call main.lb_type_range.hide
		call main.lb_type_contour.show
		call main.lb_type_immediate.hide
		call main.lb_type_advanced.hide
		call main.tx_category.setlabel "Contour plots: (select type)"
		call main.lb_type_contour.withvalue main.lb_type_contour.setvalue "@"
		call script ifin_enable
	}
	if main.rb_fit {
		call main.lb_type_basic.hide
		call main.lb_type_fit.show
		call main.lb_type_range.hide
		call main.lb_type_contour.hide
		call main.lb_type_immediate.hide
		call main.lb_type_advanced.hide
		call main.tx_category.setlabel "Fit plots: (select type)"
		call main.lb_type_fit.withvalue main.lb_type_fit.setvalue "@"
		call script ifin_enable
	}	
	if main.rb_immediate {
		call main.lb_type_basic.hide
		call main.lb_type_fit.hide
		call main.lb_type_range.hide
		call main.lb_type_contour.hide
		call main.lb_type_immediate.show
		call main.lb_type_advanced.hide
		call main.tx_category.setlabel "Immediate plots: (select type)"
		call main.lb_type_immediate.withvalue main.lb_type_immediate.setvalue "@"
		call program im_sci_process_list // build and show list of coordinates
		call program im_pci_process_list // build and show list of coordinates
		call script ifin_disable
	}
	if main.rb_advanced {
		call main.lb_type_basic.hide
		call main.lb_type_fit.hide
		call main.lb_type_range.hide
		call main.lb_type_contour.hide
		call main.lb_type_immediate.hide
		call main.lb_type_advanced.show
		call main.tx_category.setlabel "Advanced plots: (select type)"
		call main.lb_type_advanced.withvalue main.lb_type_advanced.setvalue "@"
		call script ifin_enable
	}	
END

LIST plot_type_basic
BEGIN
	"Scatter"
	"Line"
	"Connected"
	"Area"
	"Bar"
	"Spike"
	"Dropline"
END
LIST plot_type_basic_values
BEGIN
	"scatter"
	"line"
	"connected"
	"area"
	"bar"
	"spike"
	"dropline"
END
LIST plot_type_basic_sel
BEGIN
	program basic_scatter_sel
	program basic_line_sel
	program basic_connected_sel
	program basic_area_sel
	program basic_bar_sel
	program basic_spike_sel
	program basic_dropline_sel
END

LIST plot_type_range
BEGIN
	"Range area"
	"Range bar"
	"Range spike"
	"Range spike w/cap"
	"Range spike w/symbol"
	"Range scatter"
	"Range line"
	"Range connected"
END
LIST plot_type_range_values
BEGIN
	"rarea"
	"rbar"
	"rspike"
	"rcap"
	"rcapsym"
	"rscatter"
	"rline"
	"rconnected"
END
LIST plot_type_range_sel
BEGIN
	program range_area_sel
	program range_bar_sel
	program range_spike_sel
	program range_spike_cap_sel
	program range_spike_sym_sel
	program range_scatter_sel
	program range_line_sel
	program range_connected_sel
END

LIST plot_type_contour
BEGIN
	"Contour"
	"Contour line"
END
LIST plot_type_contour_values
BEGIN
	"contour"
	"contourline"
END
LIST plot_type_contour_sel
BEGIN
	program contour_sel
	program contourline_sel
END

LIST plot_type_fit
BEGIN
	"Linear prediction"
	"Quadratic prediction"
	"Fractional polynomial"
	"Linear prediction w/CI"
	"Quadratic prediction w/CI"
	"Fractional polynomial w/CI"	
END
LIST plot_type_fit_values
BEGIN
	"lfit"
	"qfit"
	"fpfit"
	"lfitci"
	"qfitci"
	"fpfitci"
END
LIST plot_type_fit_sel
BEGIN
	program fit_lfit_sel
	program fit_qfit_sel
	program fit_fpfit_sel
	program fit_lfitci_sel
	program fit_qfitci_sel
	program fit_fpfitci_sel
END

LIST plot_type_immediate
BEGIN
	"Scatter"
	"Line"
	"Connected"
	"Paired-coordinate spike"
	"Paired-coordinate spike w/symbol"
	"Paired-coordinate scatter"
	"Paired-coordinate arrow"
	"Paired-coordinate double arrow"
END
LIST plot_type_immediate_values
BEGIN	// the spaces in the values below are intentional
	"scatteri"
	"scatteri "
	"scatteri  "
	"pci"
	"pci "
	"pci  "
	"pcarrowi"
	"pcarrowi "
END
LIST plot_type_immediate_sel
BEGIN
	program immediate_scatter_sel
	program immediate_line_sel
	program immediate_connected_sel
	program immediate_pcspike_sel
	program immediate_pccapsym_sel
	program immediate_pcscatter_sel
	program immediate_pcarrow_sel
	program immediate_pcbarrow_sel
END

LIST plot_type_advanced
BEGIN
	"Time-series line"
	"Time-series range line"
	"Median-band line"
	"Median-spline"
	"Lowess line"
	"Kernel density"
	"Histogram"
	"Local polynomial smoothed line"
	"Local polynomial smoothed line w/CI"
	"Function"
	"Paired-coordinate spike"
	"Paired-coordinate spike w/symbol"
	"Paired-coordinate arrow"
	"Paired-coordinate double arrow"
	"Paired-coordinate scatter"
END
LIST plot_type_advanced_values
BEGIN
	"tsline"
	"tsrline"
	"mband"
	"mspline"
	"lowess"
	"kdensity"
	"histogram"
	"lpoly"
	"lpolyci"
	"function"
	"pcspike"
	"pccapsym"
	"pcarrow"
	"pcbarrow"
	"pcscatter"
END
LIST plot_type_advanced_sel
BEGIN
	program advanced_tsline_sel
	program advanced_tsrline_sel
	program advanced_mband_sel
	program advanced_mspline_sel
	program advanced_lowess_sel
	program advanced_kdensity_sel
	program advanced_histogram_sel
	program advanced_locpoly_sel
	program advanced_locpolyci_sel
	program advanced_function_sel
	program advanced_pcspike_sel
	program advanced_pccapsym_sel
	program advanced_pcarrow_sel
	program advanced_pcbarrow_sel
	program advanced_pcscatter_sel
END

SCRIPT basic_show_common
BEGIN
	main.tx_basic_yvar.show
	main.vn_basic_yvar.show
	main.tx_basic_xvar.show
	main.vn_basic_xvar.show
	main.ck_basic_sortx.show
END
SCRIPT basic_hide_common
BEGIN
	main.tx_basic_yvar.hide
	main.vn_basic_yvar.hide
	main.tx_basic_xvar.hide
	main.vn_basic_xvar.hide
	main.ck_basic_sortx.hide
END
SCRIPT basic_hide_all
BEGIN
	script basic_hide_common
	main.ck_basic_y2.hide
	main.bu_basic_weight.hide
	main.bu_basic_scatter.hide
	main.bu_basic_line.hide
	main.bu_basic_area.hide
	main.bu_basic_bar.hide
	main.bu_basic_spike.hide	
END

SCRIPT range_show_common
BEGIN
	main.tx_range_yvar1.show
	main.vn_range_yvar1.show
	main.tx_range_yvar2.show
	main.vn_range_yvar2.show
	main.tx_range_xvar.show
	main.vn_range_xvar.show
	main.ck_range_sortx.show
END
SCRIPT range_hide_common
BEGIN
	main.tx_range_yvar1.hide
	main.vn_range_yvar1.hide
	main.tx_range_yvar2.hide
	main.vn_range_yvar2.hide
	main.tx_range_xvar.hide
	main.vn_range_xvar.hide
	main.ck_range_sortx.hide
END
SCRIPT range_hide_all
BEGIN
	script range_hide_common
	main.ck_range_y2.hide
	main.bu_range_area.hide
	main.bu_range_bar.hide
	main.bu_range_spike.hide
	main.cb_range_cap_size.hide
	main.tx_range_cap_size.hide
	main.bu_range_scatter.hide
	main.bu_range_line.hide
	main.bu_range_weight.hide
END

SCRIPT contour_show_common
BEGIN
	main.tx_con_zvar.show
	main.vn_con_zvar.show
	main.tx_con_yvar.show
	main.vn_con_yvar.show
	main.tx_con_xvar.show
	main.vn_con_xvar.show
END
SCRIPT contour_hide_common
BEGIN
	main.tx_con_zvar.hide
	main.vn_con_zvar.hide
	main.tx_con_yvar.hide
	main.vn_con_yvar.hide
	main.tx_con_xvar.hide
	main.vn_con_xvar.hide
	main.bu_contour.hide
	main.bu_contourline.hide
END
SCRIPT contour_hide_all
BEGIN
	script contour_hide_common
	main.ck_con_y2.hide
	main.bu_contour.hide
	main.bu_contourline.hide
END

SCRIPT fit_show_common
BEGIN
	main.tx_fit_yvar.show
	main.vn_fit_yvar.show
	main.tx_fit_xvar.show
	main.vn_fit_xvar.show
	main.bu_fit_weight.show
END
SCRIPT fit_hide_common
BEGIN
	main.tx_fit_yvar.hide
	main.vn_fit_yvar.hide
	main.tx_fit_xvar.hide
	main.vn_fit_xvar.hide
	main.bu_fit_weight.hide
END
SCRIPT fit_hide_all
BEGIN
	script fit_hide_common
	main.ck_fit_y2.hide
	main.bu_fit_lfit.hide
	main.bu_fit_qfit.hide
	main.bu_fit_fpfit.hide
	main.bu_fit_lfitci.hide
	main.bu_fit_qfitci.hide
	main.bu_fit_fpfitci.hide
END

SCRIPT immediate_show_common
BEGIN
	main.tx_im_coord.show
	main.bu_im_define.show
	main.bu_im_edit.show
	main.bu_im_delete.show
	main.ck_im_y2.show
END
SCRIPT immediate_hide_common
BEGIN
	main.tx_im_coord.hide
	main.bu_im_define.hide
	main.bu_im_edit.hide
	main.bu_im_delete.hide
	main.ck_im_y2.hide
END
SCRIPT immediate_hide_all
BEGIN
	script immediate_hide_common
	main.lb_im_sci_coord.hide
	main.lb_im_pci_coord.hide
	main.bu_im_marker.hide
	main.bu_im_line.hide
	main.bu_im_pcspike.hide
	main.bu_im_pcarrow.hide
	main.bu_im_pcmarker.hide
END

SCRIPT advanced_show_common
BEGIN
	// no objects common to all advanced plots ...
END
SCRIPT advanced_hide_common
BEGIN
	// no objects common to all advanced plots ...
END
SCRIPT advanced_hide_all
BEGIN
	main.tx_adv_zvar.hide
	main.vn_adv_zvar.hide
	main.tx_adv_yvar.hide
	main.vn_adv_yvar.hide
	main.tx_adv_function.hide
	main.ex_adv_function.hide
	main.tx_adv_function_range.hide
	main.vn_adv_function_range.hide
	main.tx_adv_yvar2.hide
	main.vn_adv_yvar2.hide
	main.ck_adv_y2.hide
	main.bu_adv_tsline.hide
	main.bu_adv_mband.hide
	main.tx_adv_xvar.hide
	main.vn_adv_xvar.hide
	main.tx_adv_xvar2.hide
	main.vn_adv_xvar2.hide
	main.ck_adv_bands.hide
	main.sp_adv_bands.hide
	main.ck_adv_n.hide
	main.sp_adv_n.hide
	main.bu_adv_lowess.hide
	main.bu_adv_lowess_line.hide
	main.bu_adv_kdensity.hide
	main.bu_adv_kdensity_line.hide
	main.bu_adv_histogram.hide
	main.bu_adv_histogram_bar.hide
	main.gb_adv_hist_data.hide
	main.rb_adv_hist_cont.hide
	main.rb_adv_hist_discrete.hide
	main.bu_adv_locpoly.hide
	main.bu_adv_locpolyci.hide
	main.bu_adv_function.hide
	main.bu_adv_function_line.hide
	main.bu_adv_pcline.hide
	main.bu_adv_pcmarker.hide
	main.bu_adv_pcarrow.hide
	main.bu_adv_weight.hide
END


//** Start selection scripts
PROGRAM basic_scatter_sel
BEGIN
	if main.rb_basic {
		call main.gb_plot.setlabel "Plot type: (scatterplot)"
		call script basic_show_common
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_basic_y2.show
			call main.bu_basic_scatter.setposition 20 270 . .
			call main.bu_basic_weight.setposition 165 270 . .
		}
		if y2Hidden {
			call main.ck_basic_y2.hide
			call main.bu_basic_scatter.setposition 20 245 . .
			call main.bu_basic_weight.setposition 165 245 . .
		}	
		call main.bu_basic_scatter.show
		call main.bu_basic_weight.show
		call main.bu_basic_line.hide
		call main.bu_basic_area.hide
		call main.bu_basic_bar.hide
		call main.bu_basic_spike.hide
	}
END

PROGRAM basic_line_sel
BEGIN
	if main.rb_basic {
		call main.gb_plot.setlabel "Plot type: (line plot)"
		call script basic_show_common
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_basic_y2.show
			call main.bu_basic_line.setposition . 270 . .
		}
		if y2Hidden {
			call main.ck_basic_y2.hide
			call main.bu_basic_line.setposition . 245 . .
		}
		call main.bu_basic_line.show
		call main.bu_basic_scatter.hide
		call main.bu_basic_weight.hide
		call main.bu_basic_area.hide
		call main.bu_basic_bar.hide
		call main.bu_basic_spike.hide
	}
END

PROGRAM basic_connected_sel
BEGIN
	if main.rb_basic {
		call main.gb_plot.setlabel "Plot type: (connected-line plot)"
		call script basic_show_common
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_basic_y2.show
			call main.bu_basic_scatter.setposition 165 270 . .
			call main.bu_basic_weight.setposition 310 270 . .
			call main.bu_basic_line.setposition . 270 . .
		}
		if y2Hidden {
			call main.ck_basic_y2.hide
			call main.bu_basic_scatter.setposition 165 245 . .
			call main.bu_basic_weight.setposition 310 245 . .
			call main.bu_basic_line.setposition . 245 . .
		}
		call main.bu_basic_scatter.show
		call main.bu_basic_weight.show
		call main.bu_basic_line.show
		call main.bu_basic_area.hide
		call main.bu_basic_bar.hide
		call main.bu_basic_spike.hide
	}
END

PROGRAM basic_area_sel
BEGIN
	if main.rb_basic {
		call main.gb_plot.setlabel "Plot type: (line plot with shading)"
		call script basic_show_common
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_basic_y2.show
			call main.bu_basic_area.setposition . 270 . .
		}
		if y2Hidden {
			call main.ck_basic_y2.hide
			call main.bu_basic_area.setposition . 245 . .
		}
		call main.bu_basic_area.show
		call main.bu_basic_scatter.hide
		call main.bu_basic_weight.hide
		call main.bu_basic_line.hide
		call main.bu_basic_bar.hide
		call main.bu_basic_spike.hide
	}
END

PROGRAM basic_bar_sel
BEGIN
	if main.rb_basic {
		call main.gb_plot.setlabel "Plot type: (bar plot)"
		call script basic_show_common
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_basic_y2.show
			call main.bu_basic_bar.setposition . 270 . .
		}
		if y2Hidden {
			call main.ck_basic_y2.hide
			call main.bu_basic_bar.setposition . 245 . .
		}
		call main.bu_basic_bar.show
		call main.bu_basic_scatter.hide
		call main.bu_basic_weight.hide
		call main.bu_basic_line.hide
		call main.bu_basic_area.hide
		call main.bu_basic_spike.hide
	}
END

PROGRAM basic_spike_sel
BEGIN
	if main.rb_basic {
		call main.gb_plot.setlabel "Plot type: (spike plot)"
		call script basic_show_common
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_basic_y2.show
			call main.bu_basic_spike.setposition . 270 . .
		}
		if y2Hidden {
			call main.ck_basic_y2.hide
			call main.bu_basic_spike.setposition . 245 . .
		}
		call main.bu_basic_spike.show
		call main.bu_basic_scatter.hide
		call main.bu_basic_weight.hide
		call main.bu_basic_line.hide
		call main.bu_basic_area.hide
		call main.bu_basic_bar.hide
	}
END

PROGRAM basic_dropline_sel
BEGIN
	if main.rb_basic {
		call main.gb_plot.setlabel "Plot type: (dropline plot)"
		call script basic_show_common
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_basic_y2.show
			call main.bu_basic_scatter.setposition 165 270 . .
			call main.bu_basic_weight.setposition 310 270 . .
			call main.bu_basic_spike.setposition . 270 . .
		}
		if y2Hidden {
			call main.ck_basic_y2.hide
			call main.bu_basic_scatter.setposition 165 245 . .
			call main.bu_basic_weight.setposition 310 245 . .
			call main.bu_basic_spike.setposition . 245 . .
		}
		call main.bu_basic_scatter.show
		call main.bu_basic_weight.show
		call main.bu_basic_spike.show
		call main.bu_basic_line.hide
		call main.bu_basic_area.hide
		call main.bu_basic_bar.hide
	}
END

PROGRAM range_area_sel
BEGIN
	if main.rb_range {
		call main.gb_plot.setlabel "Plot type: (range plot with area shading)"
		call script range_show_common
		call script basic_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_range_y2.show
		}
		if y2Hidden {
			call main.ck_range_y2.hide
		}
		call main.bu_range_area.show
		call main.bu_range_bar.hide
		call main.bu_range_spike.hide
		call main.cb_range_cap_size.hide
		call main.tx_range_cap_size.hide
		call main.bu_range_scatter.hide
		call main.bu_range_weight.hide
		call main.bu_range_line.hide
	}
END

PROGRAM range_bar_sel
BEGIN
	if main.rb_range {
		call main.gb_plot.setlabel "Plot type: (range plot with bars)"
		call script range_show_common
		call script basic_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_range_y2.show
		}
		if y2Hidden {
			call main.ck_range_y2.hide
		}
		call main.bu_range_bar.show
		call main.bu_range_area.hide
		call main.bu_range_spike.hide
		call main.cb_range_cap_size.hide
		call main.tx_range_cap_size.hide
		call main.bu_range_scatter.hide
		call main.bu_range_weight.hide
		call main.bu_range_line.hide
	}
END

PROGRAM range_spike_sel
BEGIN
	if main.rb_range {
		call main.gb_plot.setlabel "Plot type: (range plot with spikes)"
		call script range_show_common
		call script basic_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_range_y2.show
		}
		if y2Hidden {
			call main.ck_range_y2.hide
		}
		call main.bu_range_spike.show
		call main.bu_range_area.hide
		call main.bu_range_bar.hide
		call main.cb_range_cap_size.hide
		call main.tx_range_cap_size.hide
		call main.bu_range_scatter.hide
		call main.bu_range_weight.hide
		call main.bu_range_line.hide
	}
END

PROGRAM range_spike_cap_sel
BEGIN
	if main.rb_range {
		call main.gb_plot.setlabel "Plot type: (range plot with capped spikes)"
		call script range_show_common
		call script basic_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_range_y2.show
		}
		if y2Hidden {
			call main.ck_range_y2.hide
		}
		call main.bu_range_spike.show
		call main.cb_range_cap_size.show
		call main.tx_range_cap_size.show
		call main.bu_range_area.hide
		call main.bu_range_bar.hide
		call main.bu_range_scatter.hide
		call main.bu_range_weight.hide
		call main.bu_range_line.hide
	}
END

PROGRAM range_spike_sym_sel
BEGIN
	if main.rb_range {
		call main.gb_plot.setlabel "Plot type: (range plot with spikes capped with symbols)"
		call script range_show_common
		call script basic_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_range_y2.show
			call main.bu_range_scatter.setposition 165 . . .
			call main.bu_range_weight.setposition 310 . . .
		}
		if y2Hidden {
			call main.ck_range_y2.hide
			call main.bu_range_scatter.setposition 165 . . .
			call main.bu_range_weight.setposition 310 . . .
		}
		call main.bu_range_spike.show
		call main.bu_range_scatter.show
		call main.bu_range_weight.show
		call main.bu_range_area.hide
		call main.bu_range_bar.hide
		call main.cb_range_cap_size.hide
		call main.tx_range_cap_size.hide
		call main.bu_range_line.hide
	}
END

PROGRAM range_scatter_sel
BEGIN
	if main.rb_range {
		call main.gb_plot.setlabel "Plot type: (range plot with markers)"
		call script range_show_common
		call script basic_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_range_y2.show
			call main.bu_range_scatter.setposition 20 . . .
			call main.bu_range_weight.setposition 165 . . .
		}
		if y2Hidden {
			call main.ck_range_y2.hide
			call main.bu_range_scatter.setposition 20 . . .
			call main.bu_range_weight.setposition 165 . . .
		}		
		call main.bu_range_scatter.show
		call main.bu_range_weight.show
		call main.bu_range_area.hide
		call main.bu_range_bar.hide
		call main.bu_range_spike.hide
		call main.cb_range_cap_size.hide
		call main.tx_range_cap_size.hide
		call main.bu_range_line.hide
	}
END

PROGRAM range_line_sel
BEGIN
	if main.rb_range {
		call main.gb_plot.setlabel "Plot type: (range plot with lines)"
		call script range_show_common
		call script basic_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_range_y2.show
		}
		if y2Hidden {
			call main.ck_range_y2.hide
		}
		call main.bu_range_line.show
		call main.bu_range_area.hide
		call main.bu_range_bar.hide
		call main.bu_range_spike.hide
		call main.cb_range_cap_size.hide
		call main.tx_range_cap_size.hide
		call main.bu_range_scatter.hide
		call main.bu_range_weight.hide
	}
END

PROGRAM range_connected_sel
BEGIN
	if main.rb_range {
		call main.gb_plot.setlabel "Plot type: (range plot with lines and markers)"
		call script range_show_common
		call script basic_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_range_y2.show
			call main.bu_range_scatter.setposition 165 . . .
			call main.bu_range_weight.setposition 310 . . .
		}
		if y2Hidden {
			call main.ck_range_y2.hide
			call main.bu_range_scatter.setposition 165 . . .
			call main.bu_range_weight.setposition 310 . . . 
		}
		call main.bu_range_line.show
		call main.bu_range_scatter.show
		call main.bu_range_weight.show
		call main.bu_range_area.hide
		call main.bu_range_bar.hide
		call main.bu_range_spike.hide
		call main.cb_range_cap_size.hide
		call main.tx_range_cap_size.hide
	}
END

PROGRAM contour_sel
BEGIN
	if main.rb_contour {
		call main.gb_plot.setlabel "Plot type: (contour plot)"
		call script contour_show_common
		call script basic_hide_all
		call script range_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_con_y2.show
		}
		if y2Hidden {
			call main.ck_con_y2.hide
		}
		call main.bu_contour.show
		call main.bu_contourline.hide
	}
END

PROGRAM contourline_sel
BEGIN
	if main.rb_contour {
		call main.gb_plot.setlabel "Plot type: (contourline plot)"
		call script contour_show_common
		call script basic_hide_all
		call script range_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_con_y2.show
		}
		if y2Hidden {
			call main.ck_con_y2.hide
		}
		call main.bu_contour.hide
		call main.bu_contourline.show
	}
END

PROGRAM fit_lfit_sel
BEGIN
	if main.rb_fit {
		call main.gb_plot.setlabel "Plot type: (linear prediction plot)"
		call script fit_show_common
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_fit_y2.show
			call main.bu_fit_lfit.setposition . 270 . .
		}
		if y2Hidden {
			call main.ck_fit_y2.hide
			call main.bu_fit_lfit.setposition . 245 . .
		}
		call main.bu_fit_lfit.show
		call main.bu_fit_qfit.hide
		call main.bu_fit_fpfit.hide
		call main.bu_fit_lfitci.hide
		call main.bu_fit_qfitci.hide
		call main.bu_fit_fpfitci.hide
	}
END

PROGRAM fit_qfit_sel
BEGIN
	if main.rb_fit {
		call main.gb_plot.setlabel "Plot type: (quadratic prediction plot)"
		call script fit_show_common
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_fit_y2.show
			call main.bu_fit_qfit.setposition . 270 . .
		}
		if y2Hidden {
			call main.ck_fit_y2.hide
			call main.bu_fit_qfit.setposition . 245 . .
		}
		call main.bu_fit_qfit.show
		call main.bu_fit_lfit.hide
		call main.bu_fit_fpfit.hide
		call main.bu_fit_lfitci.hide
		call main.bu_fit_qfitci.hide
		call main.bu_fit_fpfitci.hide
	}
END

PROGRAM fit_fpfit_sel
BEGIN
	if main.rb_fit {
		call main.gb_plot.setlabel "Plot type: (fractional polynomial plot)"
		call script fit_show_common
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_fit_y2.show
			call main.bu_fit_fpfit.setposition . 270 . .
		}
		if y2Hidden {
			call main.ck_fit_y2.hide
			call main.bu_fit_fpfit.setposition . 245 . .
		}
		call main.bu_fit_fpfit.show
		call main.bu_fit_lfit.hide
		call main.bu_fit_qfit.hide
		call main.bu_fit_lfitci.hide
		call main.bu_fit_qfitci.hide
		call main.bu_fit_fpfitci.hide
	}
END

PROGRAM fit_lfitci_sel
BEGIN
	if main.rb_fit {
		call main.gb_plot.setlabel "Plot type: (linear prediction plot with confidence intervals)"
		call script fit_show_common
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_fit_y2.show
			call main.bu_fit_lfitci.setposition . 270 . .
		}
		if y2Hidden {
			call main.ck_fit_y2.hide
			call main.bu_fit_lfitci.setposition . 245 . .
		}
		call main.bu_fit_lfitci.show
		call main.bu_fit_lfit.hide
		call main.bu_fit_qfit.hide
		call main.bu_fit_fpfit.hide
		call main.bu_fit_qfitci.hide
		call main.bu_fit_fpfitci.hide
	}
END

PROGRAM fit_qfitci_sel
BEGIN
	if main.rb_fit {
		call main.gb_plot.setlabel "Plot type: (quadratic prediction plot with confidence intervals)"
		call script fit_show_common
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_fit_y2.show
			call main.bu_fit_qfitci.setposition . 270 . .
		}
		if y2Hidden {
			call main.ck_fit_y2.hide
			call main.bu_fit_qfitci.setposition . 245 . .
		}
		call main.bu_fit_qfitci.show
		call main.bu_fit_lfit.hide
		call main.bu_fit_qfit.hide
		call main.bu_fit_fpfit.hide
		call main.bu_fit_lfitci.hide
		call main.bu_fit_fpfitci.hide
	}
END

PROGRAM fit_fpfitci_sel
BEGIN
	if main.rb_fit {
		call main.gb_plot.setlabel "Plot type: (fractional polynomial plot with confidence intervals)"
		call script fit_show_common
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script immediate_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_fit_y2.show
			call main.bu_fit_fpfitci.setposition . 270 . .
		}
		if y2Hidden {
			call main.ck_fit_y2.hide
			call main.bu_fit_fpfitci.setposition . 245 . .
		}
		call main.bu_fit_fpfitci.show
		call main.bu_fit_lfit.hide
		call main.bu_fit_qfit.hide
		call main.bu_fit_fpfit.hide
		call main.bu_fit_lfitci.hide
		call main.bu_fit_qfitci.hide
	}
END

PROGRAM immediate_scatter_sel
BEGIN
	if main.rb_immediate {
		call main.gb_plot.setlabel "Plot type: (scatterplot with immediate arguments)"
		call main.tx_im_coord.setlabel "Coordinates:"
		call script immediate_show_common
		call main.lb_im_sci_coord.show
		call main.lb_im_pci_coord.hide
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_im_y2.show
		}
		if y2Hidden {
			call main.ck_im_y2.hide
		}
		call immediateRecast.setstring ""
		call main.bu_im_marker.show
		call main.bu_im_marker.setposition 240 .
		call main.bu_im_line.hide
		call main.bu_im_pcspike.hide
		call main.bu_im_pcarrow.hide
		call main.bu_im_pcmarker.hide
	}
END

PROGRAM immediate_line_sel
BEGIN
	if main.rb_immediate {
		call main.gb_plot.setlabel "Plot type: (line plot with immediate arguments)"
		call main.tx_im_coord.setlabel "Coordinates:"
		call script immediate_show_common
		call main.lb_im_sci_coord.show
		call main.lb_im_pci_coord.hide
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_im_y2.show
		}
		if y2Hidden {
			call main.ck_im_y2.hide
		}
		call immediateRecast.setstring "recast(line)"
		call main.bu_im_line.show
		call main.bu_im_marker.hide
		call main.bu_im_pcspike.hide
		call main.bu_im_pcarrow.hide
		call main.bu_im_pcmarker.hide
	}
END

PROGRAM immediate_connected_sel
BEGIN
	if main.rb_immediate {
		call main.gb_plot.setlabel "Plot type: (connected-line plot with immediate arguments)"
		call main.tx_im_coord.setlabel "Coordinates:"
		call script immediate_show_common
		call main.lb_im_sci_coord.show
		call main.lb_im_pci_coord.hide
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_im_y2.show
		}
		if y2Hidden {
			call main.ck_im_y2.hide
		}
		call immediateRecast.setstring "recast(connected)"
		call main.bu_im_line.show
		call main.bu_im_marker.show
		call main.bu_im_marker.setposition 380 .
		call main.bu_im_pcspike.hide
		call main.bu_im_pcarrow.hide
		call main.bu_im_pcmarker.hide
	}
END

PROGRAM immediate_pcspike_sel
BEGIN
	if main.rb_immediate {
		call main.gb_plot.setlabel "Plot type: (paired-coordinate spike plot with immediate arguments)"
		call main.tx_im_coord.setlabel "Coordinates: (paired)"
		call script immediate_show_common
		call main.lb_im_pci_coord.show
		call main.lb_im_sci_coord.hide
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_im_y2.show
		}
		if y2Hidden {
			call main.ck_im_y2.hide
		}
		call immediateRecast.setstring ""
		call main.bu_im_pcspike.show
		call main.bu_im_line.hide
		call main.bu_im_marker.hide
		call main.bu_im_pcarrow.hide
		call main.bu_im_pcmarker.hide
	}
END

PROGRAM immediate_pccapsym_sel
BEGIN
	if main.rb_immediate {
		call main.gb_plot.setlabel "Plot type: (paired-coordinate spike plot with capped symbols and immediate arguments)"
		call main.tx_im_coord.setlabel "Coordinates: (paired)"
		call script immediate_show_common
		call main.lb_im_pci_coord.show
		call main.lb_im_sci_coord.hide
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_im_y2.show
		}
		if y2Hidden {
			call main.ck_im_y2.hide
		}
		call immediateRecast.setstring "recast(pccapsym)"
		call main.bu_im_pcspike.show
		call main.bu_im_pcmarker.show
		call main.bu_im_pcmarker.setposition 380 .
		call main.bu_im_marker.hide
		call main.bu_im_line.hide
		call main.bu_im_pcarrow.hide
	}
END

PROGRAM immediate_pcscatter_sel
BEGIN
	if main.rb_immediate {
		call main.gb_plot.setlabel "Plot type: (paired-coordinate scatter plot with immediate arguments)"
		call main.tx_im_coord.setlabel "Coordinates: (paired)"
		call script immediate_show_common
		call main.lb_im_pci_coord.show
		call main.lb_im_sci_coord.hide
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_im_y2.show
		}
		if y2Hidden {
			call main.ck_im_y2.hide
		}
		call immediateRecast.setstring "recast(pcscatter)"
		call main.bu_im_pcmarker.show
		call main.bu_im_pcmarker.setposition 240 .
		call main.bu_im_line.hide
		call main.bu_im_pcspike.hide
		call main.bu_im_pcarrow.hide
		call main.bu_im_marker.hide
	}
END

PROGRAM immediate_pcarrow_sel
BEGIN
	if main.rb_immediate {
		call main.gb_plot.setlabel "Plot type: (paired-coordinate plot with arrows and immediate arguments)"
		call main.tx_im_coord.setlabel "Coordinates: (paired)"
		call script immediate_show_common
		call main.lb_im_pci_coord.show
		call main.lb_im_sci_coord.hide
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_im_y2.show
		}
		if y2Hidden {
			call main.ck_im_y2.hide
		}
		call immediateRecast.setstring ""
		call main.bu_im_pcspike.show
		call main.bu_im_pcarrow.show
		call main.bu_im_line.hide
		call main.bu_im_marker.hide
		call main.bu_im_pcmarker.hide
	}
END

PROGRAM immediate_pcbarrow_sel
BEGIN
	if main.rb_immediate {
		call main.gb_plot.setlabel "Plot type: (paired-coordinate plot with double arrows and immediate arguments)"
		call main.tx_im_coord.setlabel "Coordinates: (paired)"
		call script immediate_show_common
		call main.lb_im_pci_coord.show
		call main.lb_im_sci_coord.hide
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script advanced_hide_all
		if ! y2Hidden {
			call main.ck_im_y2.show
		}
		if y2Hidden {
			call main.ck_im_y2.hide
		}
		call immediateRecast.setstring "recast(pcbarrow)"
		call main.bu_im_pcspike.show
		call main.bu_im_pcarrow.show
		call main.bu_im_line.hide
		call main.bu_im_marker.hide
		call main.bu_im_pcmarker.hide
	}
END

PROGRAM advanced_tsline_sel
BEGIN
	if main.rb_advanced {
		call main.gb_plot.setlabel "Plot type: (time-series line plot)"
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		if ! y2Hidden {
			call main.ck_adv_y2.show
			call main.bu_adv_tsline.setposition . 245 . .
			call main.ck_adv_y2.setposition 165 210
		}
		if y2Hidden {
			call main.ck_adv_y2.hide
			call main.bu_adv_tsline.setposition . 245 . .
		}
		call main.tx_adv_yvar.setlabel "Y variable:"
		call main.bu_adv_tsline.show
		call main.tx_adv_yvar.show
		call main.vn_adv_yvar.show
		call main.tx_adv_yvar.setposition 20 . 120 .
		call main.vn_adv_yvar.setposition 20 . 120 .
		call main.bu_adv_weight.hide
		call main.tx_adv_function.hide
		call main.ex_adv_function.hide
		call main.tx_adv_function_range.hide
		call main.vn_adv_function_range.hide
		call main.tx_adv_zvar.hide
		call main.vn_adv_zvar.hide
		call main.tx_adv_yvar2.hide
		call main.vn_adv_yvar2.hide
		call main.tx_adv_xvar.hide
		call main.vn_adv_xvar.hide
		call main.tx_adv_xvar2.hide
		call main.vn_adv_xvar2.hide
		call main.bu_adv_mband.hide
		call main.ck_adv_bands.hide
		call main.sp_adv_bands.hide
		call main.ck_adv_n.hide
		call main.sp_adv_n.hide
		call main.bu_adv_lowess.hide
		call main.bu_adv_lowess_line.hide
		call main.bu_adv_kdensity.hide
		call main.bu_adv_kdensity_line.hide
		call main.bu_adv_histogram.hide
		call main.bu_adv_histogram_bar.hide
		call main.gb_adv_hist_data.hide
		call main.rb_adv_hist_cont.hide
		call main.rb_adv_hist_discrete.hide
		call main.bu_adv_locpoly.hide
		call main.bu_adv_locpolyci.hide
		call main.bu_adv_function.hide
		call main.bu_adv_function_line.hide
		call main.bu_adv_pcline.hide
		call main.bu_adv_pcmarker.hide
		call main.bu_adv_pcarrow.hide
	}
END

PROGRAM advanced_tsrline_sel
BEGIN
	if main.rb_advanced {
		call main.gb_plot.setlabel "Plot type: (time-series range plot with lines)"
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		if ! y2Hidden {
			call main.ck_adv_y2.show
			call main.bu_adv_tsline.setposition . 295 . .
			call main.ck_adv_y2.setposition 165 210
		}
		if y2Hidden {
			call main.ck_adv_y2.hide
			call main.bu_adv_tsline.setposition . 295 . .
		}
		call main.tx_adv_yvar.setlabel "Y1 variable:"
		call main.tx_adv_xvar.setlabel "X variable:"
		call main.bu_adv_tsline.show
		call main.tx_adv_yvar.show
		call main.vn_adv_yvar.show
		call main.tx_adv_yvar.setposition 20 . 120 .
		call main.vn_adv_yvar.setposition 20 . 120 .
		call main.tx_adv_yvar2.show
		call main.vn_adv_yvar2.show
		call main.bu_adv_weight.hide
		call main.tx_adv_function.hide
		call main.ex_adv_function.hide
		call main.tx_adv_function_range.hide
		call main.vn_adv_function_range.hide
		call main.tx_adv_zvar.hide
		call main.vn_adv_zvar.hide
		call main.tx_adv_xvar.hide
		call main.vn_adv_xvar.hide
		call main.tx_adv_xvar2.hide
		call main.vn_adv_xvar2.hide
		call main.bu_adv_mband.hide
		call main.ck_adv_bands.hide
		call main.sp_adv_bands.hide
		call main.ck_adv_n.hide
		call main.sp_adv_n.hide
		call main.bu_adv_lowess.hide
		call main.bu_adv_lowess_line.hide
		call main.bu_adv_kdensity.hide
		call main.bu_adv_kdensity_line.hide
		call main.bu_adv_histogram.hide
		call main.bu_adv_histogram_bar.hide
		call main.gb_adv_hist_data.hide
		call main.rb_adv_hist_cont.hide
		call main.rb_adv_hist_discrete.hide
		call main.bu_adv_locpoly.hide
		call main.bu_adv_locpolyci.hide
		call main.bu_adv_function.hide
		call main.bu_adv_function_line.hide
		call main.bu_adv_pcline.hide
		call main.bu_adv_pcmarker.hide
		call main.bu_adv_pcarrow.hide
	}
END

PROGRAM advanced_mband_sel
BEGIN
	if main.rb_advanced {
		call main.gb_plot.setlabel "Plot type: (median-band line plot)"
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		if ! y2Hidden {
			call main.ck_adv_y2.show
			call main.ck_adv_y2.setposition 20 240
			call main.bu_adv_mband.setposition . 270
		}
		if y2Hidden {
			call main.ck_adv_y2.hide
			call main.bu_adv_mband.setposition . 245
		}
		call main.tx_adv_yvar.setlabel "Y variable:"
		call main.tx_adv_xvar.setlabel "X variable:"
		call main.tx_adv_xvar.show
		call main.vn_adv_xvar.show
		call main.tx_adv_xvar.setposition 165 . 120 .
		call main.vn_adv_xvar.setposition 165 . 120 .
		call main.tx_adv_yvar.show
		call main.vn_adv_yvar.show
		call main.tx_adv_yvar.setposition 20 . 120 .
		call main.vn_adv_yvar.setposition 20 . 120 .
		call main.bu_adv_mband.show
		call main.ck_adv_bands.show
		call main.sp_adv_bands.show
		call main.bu_adv_weight.hide
		call main.tx_adv_function.hide
		call main.ex_adv_function.hide
		call main.tx_adv_function_range.hide
		call main.vn_adv_function_range.hide
		call main.bu_adv_tsline.hide
		call main.tx_adv_zvar.hide
		call main.vn_adv_zvar.hide
		call main.tx_adv_yvar2.hide
		call main.vn_adv_yvar2.hide
		call main.tx_adv_xvar2.hide
		call main.vn_adv_xvar2.hide
		call main.ck_adv_n.hide
		call main.sp_adv_n.hide
		call main.bu_adv_lowess.hide
		call main.bu_adv_lowess_line.hide
		call main.bu_adv_kdensity.hide
		call main.bu_adv_kdensity_line.hide
		call main.bu_adv_histogram.hide
		call main.bu_adv_histogram_bar.hide
		call main.gb_adv_hist_data.hide
		call main.rb_adv_hist_cont.hide
		call main.rb_adv_hist_discrete.hide
		call main.bu_adv_locpoly.hide
		call main.bu_adv_locpolyci.hide
		call main.bu_adv_function.hide
		call main.bu_adv_function_line.hide
		call main.bu_adv_pcline.hide
		call main.bu_adv_pcmarker.hide
		call main.bu_adv_pcarrow.hide
	}
END

PROGRAM advanced_mspline_sel
BEGIN
	if main.rb_advanced {
		call main.gb_plot.setlabel "Plot type: (median-spline line plot)"
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		if ! y2Hidden {
			call main.ck_adv_y2.show
			call main.ck_adv_y2.setposition 20 240
			call main.bu_adv_mband.setposition . 270
		}
		if y2Hidden {
			call main.ck_adv_y2.hide
			call main.bu_adv_mband.setposition . 245
		}
		call main.tx_adv_yvar.setlabel "Y variable:"
		call main.tx_adv_xvar.setlabel "X variable:"
		call main.tx_adv_yvar.show
		call main.vn_adv_yvar.show
		call main.tx_adv_yvar.setposition 20 . 120 .
		call main.vn_adv_yvar.setposition 20 . 120 .
		call main.tx_adv_xvar.show
		call main.vn_adv_xvar.show
		call main.tx_adv_xvar.setposition 165 . 120 .
		call main.vn_adv_xvar.setposition 165 . 120 .
		call main.bu_adv_mband.show
		call main.ck_adv_bands.show
		call main.sp_adv_bands.show
		call main.ck_adv_n.show
		call main.sp_adv_n.show
		call main.bu_adv_weight.hide
		call main.tx_adv_function.hide
		call main.ex_adv_function.hide
		call main.tx_adv_function_range.hide
		call main.vn_adv_function_range.hide
		call main.bu_adv_tsline.hide
		call main.tx_adv_zvar.hide
		call main.vn_adv_zvar.hide
		call main.tx_adv_yvar2.hide
		call main.vn_adv_yvar2.hide
		call main.tx_adv_xvar2.hide
		call main.vn_adv_xvar2.hide
		call main.bu_adv_lowess.hide
		call main.bu_adv_lowess_line.hide
		call main.bu_adv_kdensity.hide
		call main.bu_adv_kdensity_line.hide
		call main.bu_adv_histogram.hide
		call main.bu_adv_histogram_bar.hide
		call main.gb_adv_hist_data.hide
		call main.rb_adv_hist_cont.hide
		call main.rb_adv_hist_discrete.hide
		call main.bu_adv_locpoly.hide
		call main.bu_adv_locpolyci.hide
		call main.bu_adv_function.hide
		call main.bu_adv_function_line.hide
		call main.bu_adv_pcline.hide
		call main.bu_adv_pcmarker.hide
		call main.bu_adv_pcarrow.hide
	}
END

PROGRAM advanced_lowess_sel
BEGIN
	if main.rb_advanced {
		call main.gb_plot.setlabel "Plot type: (lowess line plot)"
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		if ! y2Hidden {
			call main.ck_adv_y2.show
			call main.ck_adv_y2.setposition 20 240
			call main.bu_adv_lowess.setposition . 270
			call main.bu_adv_lowess_line.setposition . 270
		}
		if y2Hidden {
			call main.ck_adv_y2.hide
			call main.bu_adv_lowess.setposition . 245
			call main.bu_adv_lowess_line.setposition . 245
		}
		call main.tx_adv_yvar.setlabel "Y variable:"
		call main.tx_adv_xvar.setlabel "X variable:"
		call main.tx_adv_yvar.show
		call main.vn_adv_yvar.show
		call main.tx_adv_yvar.setposition 20 . 120 .
		call main.vn_adv_yvar.setposition 20 . 120 .
		call main.tx_adv_xvar.show
		call main.vn_adv_xvar.show
		call main.tx_adv_xvar.setposition 165 . 120 .
		call main.vn_adv_xvar.setposition 165 . 120 .
		call main.bu_adv_lowess.show
		call main.bu_adv_lowess_line.show
		call main.bu_adv_weight.hide
		call main.tx_adv_function.hide
		call main.ex_adv_function.hide
		call main.tx_adv_function_range.hide
		call main.vn_adv_function_range.hide
		call main.bu_adv_mband.hide
		call main.ck_adv_bands.hide
		call main.sp_adv_bands.hide
		call main.ck_adv_n.hide
		call main.sp_adv_n.hide
		call main.bu_adv_tsline.hide
		call main.tx_adv_zvar.hide
		call main.vn_adv_zvar.hide
		call main.tx_adv_yvar2.hide
		call main.vn_adv_yvar2.hide
		call main.tx_adv_xvar2.hide
		call main.vn_adv_xvar2.hide
		call main.bu_adv_kdensity.hide
		call main.bu_adv_kdensity_line.hide
		call main.bu_adv_histogram.hide
		call main.bu_adv_histogram_bar.hide
		call main.gb_adv_hist_data.hide
		call main.rb_adv_hist_cont.hide
		call main.rb_adv_hist_discrete.hide
		call main.bu_adv_locpoly.hide
		call main.bu_adv_locpolyci.hide
		call main.bu_adv_function.hide
		call main.bu_adv_function_line.hide
		call main.bu_adv_pcline.hide
		call main.bu_adv_pcmarker.hide
		call main.bu_adv_pcarrow.hide
	}
END

PROGRAM advanced_kdensity_sel
BEGIN
	if main.rb_advanced {
		call main.gb_plot.setlabel "Plot type: (kernel density plot)"
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		if ! y2Hidden {
			call main.ck_adv_y2.show
			call main.ck_adv_y2.setposition 20 240
			call main.bu_adv_kdensity.setposition . 270
			call main.bu_adv_kdensity_line.setposition . 270
		}
		if y2Hidden {
			call main.ck_adv_y2.hide
			call main.bu_adv_kdensity.setposition . 245
			call main.bu_adv_kdensity_line.setposition . 245
		}
		call main.tx_adv_xvar.setlabel "X variable:"
		call main.tx_adv_xvar.show
		call main.vn_adv_xvar.show
		call main.tx_adv_xvar.setposition 20 . 130 .
		call main.vn_adv_xvar.setposition 20 . 130 .
		call main.bu_adv_kdensity.show
		call main.bu_adv_kdensity_line.show
		call main.bu_adv_weight.show
		call main.bu_adv_weight.setposition 165 .
		call main.tx_adv_function.hide
		call main.ex_adv_function.hide
		call main.tx_adv_function_range.hide
		call main.vn_adv_function_range.hide
		call main.tx_adv_yvar.hide
		call main.vn_adv_yvar.hide
		call main.bu_adv_mband.hide
		call main.ck_adv_bands.hide
		call main.sp_adv_bands.hide
		call main.ck_adv_n.hide
		call main.sp_adv_n.hide
		call main.bu_adv_tsline.hide
		call main.tx_adv_zvar.hide
		call main.vn_adv_zvar.hide
		call main.tx_adv_yvar2.hide
		call main.vn_adv_yvar2.hide
		call main.tx_adv_xvar2.hide
		call main.vn_adv_xvar2.hide
		call main.bu_adv_lowess.hide
		call main.bu_adv_lowess_line.hide
		call main.bu_adv_histogram.hide
		call main.bu_adv_histogram_bar.hide
		call main.gb_adv_hist_data.hide
		call main.rb_adv_hist_cont.hide
		call main.rb_adv_hist_discrete.hide
		call main.bu_adv_locpoly.hide
		call main.bu_adv_locpolyci.hide
		call main.bu_adv_function.hide
		call main.bu_adv_function_line.hide
		call main.bu_adv_pcline.hide
		call main.bu_adv_pcmarker.hide
		call main.bu_adv_pcarrow.hide
	}
END

PROGRAM advanced_histogram_sel
BEGIN
	if main.rb_advanced {
		call main.gb_plot.setlabel "Plot type: (histogram plot)"
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		if ! y2Hidden {
			call main.ck_adv_y2.show
			call main.ck_adv_y2.setposition 20 240
			call main.bu_adv_histogram.setposition . 270
			call main.bu_adv_histogram_bar.setposition . 270
		}
		if y2Hidden {
			call main.ck_adv_y2.hide
			call main.bu_adv_histogram.setposition . 245
			call main.bu_adv_histogram_bar.setposition . 245
		}
		call main.tx_adv_xvar.setlabel "X variable:"
		call main.tx_adv_xvar.show
		call main.vn_adv_xvar.show
		call main.tx_adv_xvar.setposition 20 . 130 .
		call main.vn_adv_xvar.setposition 20 . 130 .
		call main.gb_adv_hist_data.show
		call main.rb_adv_hist_cont.show
		call main.rb_adv_hist_discrete.show
		call main.bu_adv_histogram.show
		call main.bu_adv_histogram_bar.show
		call main.bu_adv_weight.show
		call main.bu_adv_weight.setposition 165 .
		call main.tx_adv_function.hide
		call main.ex_adv_function.hide
		call main.tx_adv_function_range.hide
		call main.vn_adv_function_range.hide
		call main.tx_adv_yvar.hide
		call main.vn_adv_yvar.hide
		call main.bu_adv_mband.hide
		call main.ck_adv_bands.hide
		call main.sp_adv_bands.hide
		call main.ck_adv_n.hide
		call main.sp_adv_n.hide
		call main.bu_adv_tsline.hide
		call main.tx_adv_zvar.hide
		call main.vn_adv_zvar.hide
		call main.tx_adv_yvar2.hide
		call main.vn_adv_yvar2.hide
		call main.tx_adv_xvar2.hide
		call main.vn_adv_xvar2.hide
		call main.bu_adv_lowess.hide
		call main.bu_adv_lowess_line.hide
		call main.bu_adv_kdensity.hide
		call main.bu_adv_kdensity_line.hide
		call main.bu_adv_locpoly.hide
		call main.bu_adv_locpolyci.hide
		call main.bu_adv_function.hide
		call main.bu_adv_function_line.hide
		call main.bu_adv_pcline.hide
		call main.bu_adv_pcmarker.hide
		call main.bu_adv_pcarrow.hide
	}
END

PROGRAM advanced_locpoly_sel
BEGIN
	if main.rb_advanced {
		call main.gb_plot.setlabel "Plot type: (local polynomial smooth plot)"
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		if ! y2Hidden {
			call main.ck_adv_y2.show
			call main.ck_adv_y2.setposition 20 240
			call main.bu_adv_locpoly.setposition . 270
		}
		if y2Hidden {
			call main.ck_adv_y2.hide
			call main.bu_adv_locpoly.setposition . 245
		}
		call main.tx_adv_yvar.setlabel "Y variable:"
		call main.tx_adv_xvar.setlabel "X variable:"
		call main.tx_adv_yvar.show
		call main.vn_adv_yvar.show
		call main.tx_adv_yvar.setposition 20 . 120 .
		call main.vn_adv_yvar.setposition 20 . 120 .
		call main.tx_adv_xvar.show
		call main.vn_adv_xvar.show
		call main.tx_adv_xvar.setposition 165 . 120 .
		call main.vn_adv_xvar.setposition 165 . 120 .
		call main.bu_adv_locpoly.show
		call main.bu_adv_weight.show
		call main.bu_adv_weight.setposition 310 .
		call main.tx_adv_function.hide
		call main.ex_adv_function.hide
		call main.tx_adv_function_range.hide
		call main.vn_adv_function_range.hide
		call main.bu_adv_mband.hide
		call main.ck_adv_bands.hide
		call main.sp_adv_bands.hide
		call main.ck_adv_n.hide
		call main.sp_adv_n.hide
		call main.bu_adv_tsline.hide
		call main.tx_adv_zvar.hide
		call main.vn_adv_zvar.hide
		call main.tx_adv_yvar2.hide
		call main.vn_adv_yvar2.hide
		call main.tx_adv_xvar2.hide
		call main.vn_adv_xvar2.hide
		call main.bu_adv_lowess.hide
		call main.bu_adv_lowess_line.hide
		call main.bu_adv_kdensity.hide
		call main.bu_adv_kdensity_line.hide
		call main.gb_adv_hist_data.hide
		call main.rb_adv_hist_cont.hide
		call main.rb_adv_hist_discrete.hide
		call main.bu_adv_histogram.hide
		call main.bu_adv_histogram_bar.hide		
		call main.bu_adv_locpolyci.hide
		call main.bu_adv_function.hide
		call main.bu_adv_function_line.hide
		call main.bu_adv_pcline.hide
		call main.bu_adv_pcmarker.hide
		call main.bu_adv_pcarrow.hide
	}
END

PROGRAM advanced_locpolyci_sel
BEGIN
	if main.rb_advanced {
		call main.gb_plot.setlabel "Plot type: (local polynomial smooth plot with confidence intervals)"
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		if ! y2Hidden {
			call main.ck_adv_y2.show
			call main.ck_adv_y2.setposition 20 240
			call main.bu_adv_locpolyci.setposition . 270
		}
		if y2Hidden {
			call main.ck_adv_y2.hide
			call main.bu_adv_locpolyci.setposition . 245
		}
		call main.tx_adv_yvar.setlabel "Y variable:"
		call main.tx_adv_xvar.setlabel "X variable:"
		call main.tx_adv_yvar.show
		call main.vn_adv_yvar.show
		call main.tx_adv_yvar.setposition 20 . 120 .
		call main.vn_adv_yvar.setposition 20 . 120 .
		call main.tx_adv_xvar.show
		call main.vn_adv_xvar.show
		call main.tx_adv_xvar.setposition 165 . 120 .
		call main.vn_adv_xvar.setposition 165 . 120 .
		call main.bu_adv_locpolyci.show
		call main.bu_adv_weight.show
		call main.bu_adv_weight.setposition 310 .
		call main.tx_adv_function.hide
		call main.ex_adv_function.hide
		call main.tx_adv_function_range.hide
		call main.vn_adv_function_range.hide
		call main.bu_adv_mband.hide
		call main.ck_adv_bands.hide
		call main.sp_adv_bands.hide
		call main.ck_adv_n.hide
		call main.sp_adv_n.hide
		call main.bu_adv_tsline.hide
		call main.tx_adv_zvar.hide
		call main.vn_adv_zvar.hide
		call main.tx_adv_yvar2.hide
		call main.vn_adv_yvar2.hide
		call main.tx_adv_xvar2.hide
		call main.vn_adv_xvar2.hide
		call main.bu_adv_lowess.hide
		call main.bu_adv_lowess_line.hide
		call main.bu_adv_kdensity.hide
		call main.bu_adv_kdensity_line.hide
		call main.gb_adv_hist_data.hide
		call main.rb_adv_hist_cont.hide
		call main.rb_adv_hist_discrete.hide
		call main.bu_adv_histogram.hide
		call main.bu_adv_histogram_bar.hide
		call main.bu_adv_locpoly.hide
		call main.bu_adv_function.hide
		call main.bu_adv_function_line.hide
		call main.bu_adv_pcline.hide
		call main.bu_adv_pcmarker.hide
		call main.bu_adv_pcarrow.hide
	}
END

PROGRAM advanced_function_sel
BEGIN
	if main.rb_advanced {
		call main.gb_plot.setlabel "Plot type: (function plot)"
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		if ! y2Hidden {
			call main.ck_adv_y2.show
			call main.ck_adv_y2.setposition 20 240
			call main.bu_adv_function.setposition 165 270
			call main.bu_adv_function_line.setposition 20 270
		}
		if y2Hidden {
			call main.ck_adv_y2.hide
			call main.bu_adv_function.setposition 165 245 
			call main.bu_adv_function_line.setposition 20 245
		}
		call main.tx_adv_function.show
		call main.ex_adv_function.show
		call main.tx_adv_function_range.show
		call main.vn_adv_function_range.show
		call main.bu_adv_function.show
		call main.bu_adv_function_line.show
		call main.bu_adv_weight.hide
		call main.tx_adv_xvar.hide
		call main.vn_adv_xvar.hide
		call main.gb_adv_hist_data.hide
		call main.rb_adv_hist_cont.hide
		call main.rb_adv_hist_discrete.hide
		call main.bu_adv_histogram.hide
		call main.bu_adv_histogram_bar.hide
		call main.tx_adv_yvar.hide
		call main.vn_adv_yvar.hide
		call main.bu_adv_mband.hide
		call main.ck_adv_bands.hide
		call main.sp_adv_bands.hide
		call main.ck_adv_n.hide
		call main.sp_adv_n.hide
		call main.bu_adv_tsline.hide
		call main.tx_adv_zvar.hide
		call main.vn_adv_zvar.hide
		call main.tx_adv_yvar2.hide
		call main.vn_adv_yvar2.hide
		call main.tx_adv_xvar2.hide
		call main.vn_adv_xvar2.hide
		call main.bu_adv_lowess.hide
		call main.bu_adv_lowess_line.hide
		call main.bu_adv_kdensity.hide
		call main.bu_adv_kdensity_line.hide
		call main.bu_adv_locpoly.hide
		call main.bu_adv_locpolyci.hide
		call main.bu_adv_pcline.hide
		call main.bu_adv_pcmarker.hide
		call main.bu_adv_pcarrow.hide
	}
END

PROGRAM advanced_pcspike_sel
BEGIN
	if main.rb_advanced {
		call main.gb_plot.setlabel "Plot type: (paired-coordinate plot with spikes)"
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		if ! y2Hidden {
			call main.ck_adv_y2.show
			call main.ck_adv_y2.setposition 305 210
		}
		if y2Hidden {
			call main.ck_adv_y2.hide
		}
		call main.tx_adv_yvar.setlabel "Y1 variable:"
		call main.tx_adv_xvar.setlabel "X1 variable:"
		call main.tx_adv_yvar.show
		call main.vn_adv_yvar.show
		call main.tx_adv_yvar.setposition 20 . 120 .
		call main.vn_adv_yvar.setposition 20 . 120 .
		call main.tx_adv_xvar.show
		call main.vn_adv_xvar.show
		call main.tx_adv_xvar.setposition 165 . 120 .
		call main.vn_adv_xvar.setposition 165 . 120 .
		call main.tx_adv_yvar2.show
		call main.vn_adv_yvar2.show
		call main.tx_adv_xvar2.show
		call main.vn_adv_xvar2.show
		call main.bu_adv_pcline.show
		call main.bu_adv_weight.hide
		call main.tx_adv_function.hide
		call main.ex_adv_function.hide
		call main.tx_adv_function_range.hide
		call main.vn_adv_function_range.hide
		call main.tx_adv_zvar.hide
		call main.vn_adv_zvar.hide
		call main.bu_adv_mband.hide
		call main.ck_adv_bands.hide
		call main.sp_adv_bands.hide
		call main.ck_adv_n.hide
		call main.sp_adv_n.hide
		call main.bu_adv_tsline.hide
		call main.bu_adv_lowess.hide
		call main.bu_adv_lowess_line.hide
		call main.bu_adv_kdensity.hide
		call main.bu_adv_kdensity_line.hide
		call main.gb_adv_hist_data.hide
		call main.rb_adv_hist_cont.hide
		call main.rb_adv_hist_discrete.hide
		call main.bu_adv_histogram.hide
		call main.bu_adv_histogram_bar.hide
		call main.bu_adv_locpoly.hide
		call main.bu_adv_locpolyci.hide
		call main.bu_adv_function.hide
		call main.bu_adv_function_line.hide
		call main.bu_adv_pcmarker.hide
		call main.bu_adv_pcarrow.hide
	}
END

PROGRAM advanced_pccapsym_sel
BEGIN
	if main.rb_advanced {
		call main.gb_plot.setlabel "Plot type: (paired-coordinate plot with capped spikes)"
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		if ! y2Hidden {
			call main.ck_adv_y2.show
			call main.ck_adv_y2.setposition 305 210
		}
		if y2Hidden {
			call main.ck_adv_y2.hide
		}
		call main.tx_adv_yvar.setlabel "Y1 variable:"
		call main.tx_adv_xvar.setlabel "X1 variable:"
		call main.tx_adv_yvar.show
		call main.vn_adv_yvar.show
		call main.tx_adv_yvar.setposition 20 . 120 .
		call main.vn_adv_yvar.setposition 20 . 120 .
		call main.tx_adv_xvar.show
		call main.vn_adv_xvar.show
		call main.tx_adv_xvar.setposition 165 . 120 .
		call main.vn_adv_xvar.setposition 165 . 120 .
		call main.tx_adv_yvar2.show
		call main.vn_adv_yvar2.show
		call main.tx_adv_xvar2.show
		call main.vn_adv_xvar2.show
		call main.bu_adv_pcline.show
		call main.bu_adv_pcmarker.show
		call main.bu_adv_pcmarker.setposition 165 .
		call main.bu_adv_weight.hide
		call main.tx_adv_function.hide
		call main.ex_adv_function.hide
		call main.tx_adv_function_range.hide
		call main.vn_adv_function_range.hide
		call main.tx_adv_zvar.hide
		call main.vn_adv_zvar.hide
		call main.bu_adv_mband.hide
		call main.ck_adv_bands.hide
		call main.sp_adv_bands.hide
		call main.ck_adv_n.hide
		call main.sp_adv_n.hide
		call main.bu_adv_tsline.hide
		call main.bu_adv_lowess.hide
		call main.bu_adv_lowess_line.hide
		call main.bu_adv_kdensity.hide
		call main.bu_adv_kdensity_line.hide
		call main.gb_adv_hist_data.hide
		call main.rb_adv_hist_cont.hide
		call main.rb_adv_hist_discrete.hide
		call main.bu_adv_histogram.hide
		call main.bu_adv_histogram_bar.hide
		call main.bu_adv_locpoly.hide
		call main.bu_adv_locpolyci.hide
		call main.bu_adv_function.hide
		call main.bu_adv_function_line.hide
		call main.bu_adv_pcarrow.hide
	}
END

PROGRAM advanced_pcarrow_sel
BEGIN
	if main.rb_advanced {
		call main.gb_plot.setlabel "Plot type: (paired-coordinate plot with arrows)"
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		if ! y2Hidden {
			call main.ck_adv_y2.show
			call main.ck_adv_y2.setposition 305 210
		}
		if y2Hidden {
			call main.ck_adv_y2.hide
		}
		call main.tx_adv_yvar.setlabel "Y1 variable:"
		call main.tx_adv_xvar.setlabel "X1 variable:"
		call main.tx_adv_yvar.show
		call main.vn_adv_yvar.show
		call main.tx_adv_yvar.setposition 20 . 120 .
		call main.vn_adv_yvar.setposition 20 . 120 .
		call main.tx_adv_xvar.show
		call main.vn_adv_xvar.show
		call main.tx_adv_xvar.setposition 165 . 120 .
		call main.vn_adv_xvar.setposition 165 . 120 .
		call main.tx_adv_yvar2.show
		call main.vn_adv_yvar2.show
		call main.tx_adv_xvar2.show
		call main.vn_adv_xvar2.show
		call main.bu_adv_pcline.show
		call main.bu_adv_pcarrow.show
		call main.bu_adv_weight.hide
		call main.tx_adv_function.hide
		call main.ex_adv_function.hide
		call main.tx_adv_function_range.hide
		call main.vn_adv_function_range.hide
		call main.tx_adv_zvar.hide
		call main.vn_adv_zvar.hide
		call main.bu_adv_mband.hide
		call main.ck_adv_bands.hide
		call main.sp_adv_bands.hide
		call main.ck_adv_n.hide
		call main.sp_adv_n.hide
		call main.bu_adv_tsline.hide
		call main.bu_adv_lowess.hide
		call main.bu_adv_lowess_line.hide
		call main.bu_adv_kdensity.hide
		call main.bu_adv_kdensity_line.hide
		call main.gb_adv_hist_data.hide
		call main.rb_adv_hist_cont.hide
		call main.rb_adv_hist_discrete.hide
		call main.bu_adv_histogram.hide
		call main.bu_adv_histogram_bar.hide
		call main.bu_adv_locpoly.hide
		call main.bu_adv_locpolyci.hide
		call main.bu_adv_function.hide
		call main.bu_adv_function_line.hide
		call main.bu_adv_pcmarker.hide
	}
END

PROGRAM advanced_pcbarrow_sel
BEGIN
	if main.rb_advanced {
		call main.gb_plot.setlabel "Plot type: (paired-coordinate plot with double arrows)"
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		if ! y2Hidden {
			call main.ck_adv_y2.show
			call main.ck_adv_y2.setposition 305 210
		}
		if y2Hidden {
			call main.ck_adv_y2.hide
		}
		call main.tx_adv_yvar.setlabel "Y1 variable:"
		call main.tx_adv_xvar.setlabel "X1 variable:"
		call main.tx_adv_yvar.show
		call main.vn_adv_yvar.show
		call main.tx_adv_yvar.setposition 20 . 120 .
		call main.vn_adv_yvar.setposition 20 . 120 .
		call main.tx_adv_xvar.show
		call main.vn_adv_xvar.show
		call main.tx_adv_xvar.setposition 165 . 120 .
		call main.vn_adv_xvar.setposition 165 . 120 .
		call main.tx_adv_yvar2.show
		call main.vn_adv_yvar2.show
		call main.tx_adv_xvar2.show
		call main.vn_adv_xvar2.show
		call main.bu_adv_pcline.show
		call main.bu_adv_pcarrow.show
		call main.bu_adv_weight.hide
		call main.tx_adv_function.hide
		call main.ex_adv_function.hide
		call main.tx_adv_function_range.hide
		call main.vn_adv_function_range.hide
		call main.tx_adv_zvar.hide
		call main.vn_adv_zvar.hide
		call main.bu_adv_mband.hide
		call main.ck_adv_bands.hide
		call main.sp_adv_bands.hide
		call main.ck_adv_n.hide
		call main.sp_adv_n.hide
		call main.bu_adv_tsline.hide
		call main.bu_adv_lowess.hide
		call main.bu_adv_lowess_line.hide
		call main.bu_adv_kdensity.hide
		call main.bu_adv_kdensity_line.hide
		call main.gb_adv_hist_data.hide
		call main.rb_adv_hist_cont.hide
		call main.rb_adv_hist_discrete.hide
		call main.bu_adv_histogram.hide
		call main.bu_adv_histogram_bar.hide
		call main.bu_adv_locpoly.hide
		call main.bu_adv_locpolyci.hide
		call main.bu_adv_function.hide
		call main.bu_adv_function_line.hide
		call main.bu_adv_pcmarker.hide
	}
END

PROGRAM advanced_pcscatter_sel
BEGIN
	if main.rb_advanced {
		call main.gb_plot.setlabel "Plot type: (paired-coordinate plot with markers)"
		call script basic_hide_all
		call script range_hide_all
		call script contour_hide_all
		call script fit_hide_all
		call script immediate_hide_all
		if ! y2Hidden {
			call main.ck_adv_y2.show
			call main.ck_adv_y2.setposition 305 210
		}
		if y2Hidden {
			call main.ck_adv_y2.hide
		}
		call main.tx_adv_yvar.setlabel "Y1 variable:"
		call main.tx_adv_xvar.setlabel "X1 variable:"
		call main.tx_adv_yvar.show
		call main.vn_adv_yvar.show
		call main.tx_adv_yvar.setposition 20 . 120 .
		call main.vn_adv_yvar.setposition 20 . 120 .
		call main.tx_adv_xvar.show
		call main.vn_adv_xvar.show
		call main.tx_adv_xvar.setposition 165 . 120 .
		call main.vn_adv_xvar.setposition 165 . 120 .
		call main.tx_adv_yvar2.show
		call main.vn_adv_yvar2.show
		call main.tx_adv_xvar2.show
		call main.vn_adv_xvar2.show
		call main.bu_adv_pcmarker.show
		call main.bu_adv_pcmarker.setposition 20 .
		call main.bu_adv_weight.hide
		call main.tx_adv_function.hide
		call main.ex_adv_function.hide
		call main.tx_adv_function_range.hide
		call main.vn_adv_function_range.hide
		call main.tx_adv_zvar.hide
		call main.vn_adv_zvar.hide
		call main.bu_adv_mband.hide
		call main.ck_adv_bands.hide
		call main.sp_adv_bands.hide
		call main.ck_adv_n.hide
		call main.sp_adv_n.hide
		call main.bu_adv_tsline.hide
		call main.bu_adv_lowess.hide
		call main.bu_adv_lowess_line.hide
		call main.bu_adv_kdensity.hide
		call main.bu_adv_kdensity_line.hide
		call main.gb_adv_hist_data.hide
		call main.rb_adv_hist_cont.hide
		call main.rb_adv_hist_discrete.hide
		call main.bu_adv_histogram.hide
		call main.bu_adv_histogram_bar.hide
		call main.bu_adv_locpoly.hide
		call main.bu_adv_locpolyci.hide
		call main.bu_adv_function.hide
		call main.bu_adv_function_line.hide
		call main.bu_adv_pcline.hide
		call main.bu_adv_pcarrow.hide
	}
END

//-- End selection scripts

SCRIPT show_basic_weight_dialog
BEGIN
	create CHILD weights AS basicWeightDialog
	basicWeightDialog.setExitString basicMarkerWeights
	basicWeightDialog.settitle "Marker weights"
	basicWeightDialog.setExitAction "program checkBasicWeights"
	basicWeightDialog.setSubmitAction "program basicWeightSubmit"
	basicWeightDialog.callthru "script weights_setLayout_fpa"
END
PROGRAM checkBasicWeights
BEGIN
	if basicMarkerWeights.iseq("") {
		call main.bu_basic_weight.setlabel "Marker weights  "
	}
	else {
		call main.bu_basic_weight.setlabel "Marker weights *"
	}
END
PROGRAM basicWeightSubmit
BEGIN
	call program checkBasicWeights
	call Submit
END

SCRIPT show_basic_marker_dialog
BEGIN
	create CHILD gr_marker_options AS basicMarker, allowsubmit
	basicMarker.setExitString basicMarkerResults
	basicMarker.settitle "Marker properties"
	basicMarker.setExitAction "program checkBasicMarkerResults"
	basicMarker.setSubmitAction "program basicMarkerSubmit"
END
PROGRAM checkBasicMarkerResults
BEGIN
	if basicMarkerResults.iseq("") {
		call main.bu_basic_scatter.setlabel "Marker properties  "
	}
	else {
		call main.bu_basic_scatter.setlabel "Marker properties *"
	}
END
PROGRAM basicMarkerSubmit
BEGIN
	call program checkBasicMarkerResults
	call Submit
END

SCRIPT show_basic_line_dialog
BEGIN
	create CHILD gr_line_options AS basicLine, allowsubmit
	basicLine.setExitString basicLineResults
	basicLine.settitle "Line properties"
	basicLine.setExitAction "program checkBasicLineResults"
	basicLine.setSubmitAction "program basicLineSubmit"
END
PROGRAM checkBasicLineResults
BEGIN
	if basicLineResults.iseq("") {
		call main.bu_basic_line.setlabel "Line properties  "
	}
	if ! basicLineResults.iseq("") {
		call main.bu_basic_line.setlabel "Line properties *"
	}
END
PROGRAM basicLineSubmit
BEGIN
	call program checkBasicLineResults
	call Submit
END

SCRIPT show_basic_area_dialog
BEGIN
	create CHILD gr_area_options AS basicArea, allowsubmit
	basicArea.setExitString basicAreaResults
	basicArea.settitle "Area properties"
	basicArea.setExitAction "program checkBasicAreaResults"
	basicArea.setSubmitAction "program basicAreaSubmit"
END
PROGRAM checkBasicAreaResults
BEGIN
	if basicAreaResults.iseq("") {
		call main.bu_basic_area.setlabel "Area properties  "
	}
	if ! basicAreaResults.iseq("") {
		call main.bu_basic_area.setlabel "Area properties *"
	}
END
PROGRAM basicAreaSubmit
BEGIN
	call program checkBasicAreaResults
	call Submit
END

SCRIPT show_basic_bar_dialog
BEGIN
	create CHILD gr_bar_options AS basicBar, allowsubmit
	basicBar.setExitString basicBarResults
	basicBar.settitle "Bar properties"
	basicBar.setExitAction "program checkBasicBarResults"
	basicBar.setSubmitAction "program basicBarSubmit"
END
PROGRAM checkBasicBarResults
BEGIN
	if basicBarResults.iseq("") {
		call main.bu_basic_bar.setlabel "Bar properties  "
	}
	if ! basicBarResults.iseq("") {
		call main.bu_basic_bar.setlabel "Bar properties *"
	}
END
PROGRAM basicBarSubmit
BEGIN
	call program checkBasicBarResults
	call Submit
END

SCRIPT show_basic_spike_dialog
BEGIN
	create CHILD gr_spike_options AS basicSpike, allowsubmit
	basicSpike.setExitString basicSpikeResults
	basicSpike.settitle "Spike properties"
	basicSpike.setExitAction "program checkBasicSpikeResults"
	basicSpike.setSubmitAction "program basicSpikeSubmit"
END
PROGRAM checkBasicSpikeResults
BEGIN
	if basicSpikeResults.iseq("") {
		call main.bu_basic_spike.setlabel "Spike properties  "
	}
	if ! basicSpikeResults.iseq("") {
		call main.bu_basic_spike.setlabel "Spike properties *"
	}
END
PROGRAM basicSpikeSubmit
BEGIN
	call program checkBasicSpikeResults
	call Submit
END

SCRIPT show_range_weight_dialog
BEGIN
	create CHILD weights AS rangeWeightDialog
	rangeWeightDialog.setExitString rangeMarkerWeights
	rangeWeightDialog.settitle "Marker weights"
	rangeWeightDialog.setExitAction "program checkRangeWeights"
	rangeWeightDialog.setSubmitAction "program rangeWeightSubmit"
	rangeWeightDialog.callthru "script weights_setLayout_fpa"
END
PROGRAM checkRangeWeights
BEGIN
	if rangeMarkerWeights.iseq("") {
		call main.bu_range_weight.setlabel "Marker weights  "
	}
	else {
		call main.bu_range_weight.setlabel "Marker weights *"
	}
END
PROGRAM rangeWeightSubmit
BEGIN
	call program checkRangeWeights
	call Submit
END

SCRIPT show_range_area_dialog
BEGIN
	create CHILD gr_rarea_options AS rangeArea, allowsubmit
	rangeArea.setExitString rangeAreaResults
	rangeArea.settitle "Area properties"
	rangeArea.setExitAction "program checkRangeAreaResults"
	rangeArea.setSubmitAction "program rangeAreaSubmit"
END
PROGRAM checkRangeAreaResults
BEGIN
	if rangeAreaResults.iseq("") {
		call main.bu_range_area.setlabel "Area properties  "
	}
	if ! rangeAreaResults.iseq("") {
		call main.bu_range_area.setlabel "Area properties *"
	}
END
PROGRAM rangeAreaSubmit
BEGIN
	call program checkRangeAreaResults
	call Submit
END

SCRIPT show_range_bar_dialog
BEGIN
	create CHILD gr_rbar_options AS rangeBar, allowsubmit
	rangeBar.setExitString rangeBarResults
	rangeBar.settitle "Bar properties"
	rangeBar.setExitAction "program checkRangeBarResults"
	rangeBar.setSubmitAction "program rangeBarSubmit"
END
PROGRAM checkRangeBarResults
BEGIN
	if rangeBarResults.iseq("") {
		call main.bu_range_bar.setlabel "Bar properties  "
	}
	if ! rangeBarResults.iseq("") {
		call main.bu_range_bar.setlabel "Bar properties *"
	}
END
PROGRAM rangeBarSubmit
BEGIN
	call program checkRangeBarResults
	call Submit
END

SCRIPT show_range_spike_dialog
BEGIN
	create CHILD gr_rspike_options AS rangeSpike, allowsubmit
	rangeSpike.setExitString rangeSpikeResults
	rangeSpike.settitle "Spike properties"
	rangeSpike.setExitAction "program checkRangeSpikeResults"
	rangeSpike.setSubmitAction "program rangeSpikeSubmit"
END
PROGRAM checkRangeSpikeResults
BEGIN
	if rangeSpikeResults.iseq("") {
		call main.bu_range_spike.setlabel "Spike properties  "
	}
	if ! rangeSpikeResults.iseq("") {
		call main.bu_range_spike.setlabel "Spike properties *"
	}
END
PROGRAM rangeSpikeSubmit
BEGIN
	call program checkRangeSpikeResults
	call Submit
END

SCRIPT show_range_marker_dialog
BEGIN
	create CHILD gr_marker_options AS rangeMarker, allowsubmit
	rangeMarker.setExitString rangeMarkerResults
	rangeMarker.settitle "Marker properties"
	rangeMarker.setExitAction "program checkRangeMarkerResults"
	rangeMarker.setSubmitAction "program rangeMarkerSubmit"
END
PROGRAM checkRangeMarkerResults
BEGIN
	if rangeMarkerResults.iseq("")  {
		call main.bu_range_scatter.setlabel "Marker properties  "
	}
	else {
		call main.bu_range_scatter.setlabel "Marker properties *"
	}
END
PROGRAM rangeMarkerSubmit
BEGIN
	call program checkRangeMarkerResults
	call Submit
END

SCRIPT show_range_line_dialog
BEGIN
	create CHILD gr_line_options AS rangeLine, allowsubmit
	rangeLine.setExitString rangeLineResults
	rangeLine.settitle "Line properties"
	rangeLine.setExitAction "program checkRangeLineResults"
	rangeLine.setSubmitAction "program rangeLineSubmit"
END
PROGRAM checkRangeLineResults
BEGIN
	if rangeLineResults.iseq("") {
		call main.bu_range_line.setlabel "Line properties  "
	}
	if rangeLineResults.isneq("") {
		call main.bu_range_line.setlabel "Line properties *"
	}
END
PROGRAM rangeLineSubmit
BEGIN
	call program checkRangeLineResults
	call Submit
END

PROGRAM show_contour_dialog
BEGIN
	call create CHILD gr_contour_options AS Contour, allowsubmit
	call Contour.setExitString ContourResults
	call Contour.settitle "Contour properties"
	call Contour.setExitAction "program checkContourResults"
	call Contour.setSubmitAction "program ContourSubmit"
END
PROGRAM checkContourResults
BEGIN
	if ContourResults.iseq("") {
		call main.bu_contour.setlabel "Contour properties  "
	}
	if ContourResults.isneq("") {
		call main.bu_contour.setlabel "Contour properties *"
	}
END
PROGRAM ContourSubmit
BEGIN
	call program checkContourResults
	call Submit
END

PROGRAM show_contourline_dialog
BEGIN
	call create CHILD gr_contourline_options AS ContourLine, allowsubmit
	call ContourLine.setExitString ContourLineResults
	call ContourLine.settitle "Contour properties"
	call ContourLine.setExitAction "program checkContourLineResults"
	call ContourLine.setSubmitAction "program ContourLineSubmit"
END
PROGRAM checkContourLineResults
BEGIN
	if ContourLineResults.iseq("") {
		call main.bu_contourline.setlabel "Contour properties  "
	}
	if ContourResults.isneq("") {
		call main.bu_contourline.setlabel "Contour properties *"
	}
END
PROGRAM ContourLineSubmit
BEGIN
	call program checkContourLineResults
	call Submit
END

SCRIPT show_fit_weight_dialog
BEGIN
	create CHILD weights AS fitWeightDialog
	fitWeightDialog.setExitString fitWeights
	fitWeightDialog.settitle "Weights"
	fitWeightDialog.setExitAction "program checkFitWeights"
	fitWeightDialog.setSubmitAction "program fitSubmit"
	fitWeightDialog.callthru "script weights_setLayout_fpa"
END
PROGRAM checkFitWeights
BEGIN
	if fitWeights.iseq("") {
		call main.bu_fit_weight.setlabel "Weights  "
	}
	else {
		call main.bu_fit_weight.setlabel "Weights *"
	}
END
PROGRAM fitSubmit
BEGIN
	call program checkFitWeights
	call Submit
END

SCRIPT show_fit_lfit_dialog
BEGIN
	create CHILD gr_lfit_options AS fitLFit, allowsubmit
	fitLFit.setExitString fitLFitResults
	fitLFit.settitle "Linear prediction plot options"
	fitLFit.setExitAction "program checkFitLFitResults"
	fitLFit.setSubmitAction "program fitLFitSubmit"
END
PROGRAM checkFitLFitResults
BEGIN
	if fitLFitResults.iseq("") {
		call main.bu_fit_lfit.setlabel "Options  "
	}
	if fitLFitResults.isneq("") {
		call main.bu_fit_lfit.setlabel "Options *"
	}
END
PROGRAM fitLFitSubmit
BEGIN
	call program checkFitLFitResults
	call Submit
END

SCRIPT show_fit_qfit_dialog
BEGIN
	create CHILD gr_qfit_options AS fitQFit, allowsubmit
	fitQFit.setExitString fitQFitResults
	fitQFit.settitle "Quadratic prediction plot options"
	fitQFit.setExitAction "program checkFitQFitResults"
	fitQFit.setSubmitAction "program fitQFitSubmit"
END
PROGRAM checkFitQFitResults
BEGIN
	if fitQFitResults.iseq("") {
		call main.bu_fit_qfit.setlabel "Options  "
	}
	if fitQFitResults.isneq("") {
		call main.bu_fit_qfit.setlabel "Options *"
	}
END
PROGRAM fitQFitSubmit
BEGIN
	call program checkFitQFitResults
	call Submit
END

SCRIPT show_fit_fpfit_dialog
BEGIN
	create CHILD gr_fpfit_options AS fitFPFit, allowsubmit
	fitFPFit.setExitString fitFPFitResults
	fitFPFit.settitle "Fractional polynomial plot options"
	fitFPFit.setExitAction "program checkFitFPFitResults"
	fitFPFit.setSubmitAction "program fitFPFitSubmit"
END
PROGRAM checkFitFPFitResults
BEGIN
	if fitFPFitResults.iseq("") {
		call main.bu_fit_fpfit.setlabel "Options  "
	}
	if fitFPFitResults.isneq("") {
		call main.bu_fit_fpfit.setlabel "Options *"
	}
END
PROGRAM fitFPFitSubmit
BEGIN
	call program checkFitFPFitResults
	call Submit
END

SCRIPT show_fit_lfitci_dialog
BEGIN
	create CHILD gr_lfitci_options AS fitLFitCi, allowsubmit
	fitLFitCi.setExitString fitLFitCiResults
	fitLFitCi.settitle "Linear prediction plot options with CIs"
	fitLFitCi.setExitAction "program checkFitLFitCiResults"
	fitLFitCi.setSubmitAction "program fitLFitCiSubmit"
END
PROGRAM checkFitLFitCiResults
BEGIN
	if fitLFitCiResults.iseq("") {
		call main.bu_fit_lfitci.setlabel "Options  "
	}
	if fitLFitCiResults.isneq("") {
		call main.bu_fit_lfitci.setlabel "Options *"
	}
END
PROGRAM fitLFitCiSubmit
BEGIN
	call program checkFitLFitCiResults
	call Submit
END

SCRIPT show_fit_qfitci_dialog
BEGIN
	create CHILD gr_qfitci_options AS fitQFitCi, allowsubmit
	fitQFitCi.setExitString fitQFitCiResults
	fitQFitCi.settitle "Quadratic prediction plot options with CIs"
	fitQFitCi.setExitAction "program checkFitQFitCiResults"
	fitQFitCi.setSubmitAction "program fitQFitCiSubmit"
END
PROGRAM checkFitQFitCiResults
BEGIN
	if fitQFitCiResults.iseq("") {
		call main.bu_fit_qfitci.setlabel "Options  "
	}
	if fitQFitCiResults.isneq("") {
		call main.bu_fit_qfitci.setlabel "Options *"
	}
END
PROGRAM fitQFitCiSubmit
BEGIN
	call program checkFitQFitCiResults
	call Submit
END

SCRIPT show_fit_fpfitci_dialog
BEGIN
	create CHILD gr_fpfitci_options AS fitFPFitCi, allowsubmit
	fitFPFitCi.setExitString fitFPFitCiResults
	fitFPFitCi.settitle "Fractional polynomial plot options with CIs"
	fitFPFitCi.setExitAction "program checkFitFPFitCiResults"
	fitFPFitCi.setSubmitAction "program fitFPFitCiSubmit"
END
PROGRAM checkFitFPFitCiResults
BEGIN
	if fitFPFitCiResults.iseq("") {
		call main.bu_fit_fpfitci.setlabel "Options  "
	}
	if fitFPFitCiResults.isneq("") {
		call main.bu_fit_fpfitci.setlabel "Options *"
	}
END
PROGRAM fitFPFitCiSubmit
BEGIN
	call program checkFitFPFitCiResults
	call Submit
END


PROGRAM im_create
BEGIN
    if main.lb_type_immediate.contains("scatteri") {
	if im_sci_counter.iseq(0) {
		call script im_make_sci1
	}
	if im_sci_counter.iseq(1) {
		call script im_make_sci2
	}
	if im_sci_counter.iseq(2) {
		call script im_make_sci3
	}
	if im_sci_counter.iseq(3) {
		call script im_make_sci4
	}
	if im_sci_counter.iseq(4) {
		call script im_make_sci5
	}
	if im_sci_counter.iseq(5) {
		call script im_make_sci6
	}
	if im_sci_counter.iseq(6) {
		call script im_make_sci7
	}
	if im_sci_counter.iseq(7) {
		call script im_make_sci8
	}
	if im_sci_counter.iseq(8) {
		call script im_make_sci9
	}
	if im_sci_counter.iseq(9) {
		call script im_make_sci10
	}
	if im_sci_counter.iseq(10) {
		call script im_make_sci11
	}
	if im_sci_counter.iseq(11) {
		call script im_make_sci12
	}
	if im_sci_counter.iseq(12) {
		call script im_make_sci13
	}
	if im_sci_counter.iseq(13) {
		call script im_make_sci14
	}
	if im_sci_counter.iseq(14) {
		call script im_make_sci15
	}
	if im_sci_counter.iseq(15) {
		call script im_make_sci16
	}
	if im_sci_counter.iseq(16) {
		call script im_make_sci17
	}
	if im_sci_counter.iseq(17) {
		call script im_make_sci18
	}
	if im_sci_counter.iseq(18) {
		call script im_make_sci19
	}
	if im_sci_counter.iseq(19) {
		call script im_make_sci20
	}
	if im_sci_counter.iseq(20) {
		call script im_make_sci21
	}
	if im_sci_counter.iseq(21) {
		call script im_make_sci22
	}
	if im_sci_counter.iseq(22) {
		call script im_make_sci23
	}
	if im_sci_counter.iseq(23) {
		call script im_make_sci24
	}
	if im_sci_counter.iseq(24) {
		call script im_make_sci25
	}
	if im_sci_counter.iseq(25) {
		call script im_make_sci26
	}
	if im_sci_counter.iseq(26) {
		call script im_make_sci27
	}
	if im_sci_counter.iseq(27) {
		call script im_make_sci28
	}
	if im_sci_counter.iseq(28) {
		call script im_make_sci29
	}
	if im_sci_counter.iseq(29) {
		call script im_make_sci30
	}
	if im_sci_counter.iseq(30) {
		call script im_make_sci31
	}
	if im_sci_counter.iseq(31) {
		call script im_make_sci32
	}
	if im_sci_counter.iseq(32) {
		stopbox stop "Limit exceeded."	///
			"Only 32 coordinates may be defined for each plot."
	}
    }
    
    if main.lb_type_immediate.contains("pci") 		///
	| main.lb_type_immediate.contains("pcarrowi") 	///
    {
	if im_pci_counter.iseq(0) {
		call script im_make_pci1
	}
	if im_pci_counter.iseq(1) {
		call script im_make_pci2
	}
	if im_pci_counter.iseq(2) {
		call script im_make_pci3
	}
	if im_pci_counter.iseq(3) {
		call script im_make_pci4
	}
	if im_pci_counter.iseq(4) {
		call script im_make_pci5
	}
	if im_pci_counter.iseq(5) {
		call script im_make_pci6
	}
	if im_pci_counter.iseq(6) {
		call script im_make_pci7
	}
	if im_pci_counter.iseq(7) {
		call script im_make_pci8
	}
	if im_pci_counter.iseq(8) {
		call script im_make_pci9
	}
	if im_pci_counter.iseq(9) {
		call script im_make_pci10
	}
	if im_pci_counter.iseq(10) {
		call script im_make_pci11
	}
	if im_pci_counter.iseq(11) {
		call script im_make_pci12
	}
	if im_pci_counter.iseq(12) {
		call script im_make_pci13
	}
	if im_pci_counter.iseq(13) {
		call script im_make_pci14
	}
	if im_pci_counter.iseq(14) {
		call script im_make_pci15
	}
	if im_pci_counter.iseq(15) {
		call script im_make_pci16
	}
	if im_pci_counter.iseq(16) {
		call script im_make_pci17
	}
	if im_pci_counter.iseq(17) {
		call script im_make_pci18
	}
	if im_pci_counter.iseq(18) {
		call script im_make_pci19
	}
	if im_pci_counter.iseq(19) {
		call script im_make_pci20
	}
	if im_pci_counter.iseq(20) {
		call script im_make_pci21
	}
	if im_pci_counter.iseq(21) {
		call script im_make_pci22
	}
	if im_pci_counter.iseq(22) {
		call script im_make_pci23
	}
	if im_pci_counter.iseq(23) {
		call script im_make_pci24
	}
	if im_pci_counter.iseq(24) {
		call script im_make_pci25
	}
	if im_pci_counter.iseq(25) {
		call script im_make_pci26
	}
	if im_pci_counter.iseq(26) {
		call script im_make_pci27
	}
	if im_pci_counter.iseq(27) {
		call script im_make_pci28
	}
	if im_pci_counter.iseq(28) {
		call script im_make_pci29
	}
	if im_pci_counter.iseq(29) {
		call script im_make_pci30
	}
	if im_pci_counter.iseq(30) {
		call script im_make_pci31
	}
	if im_pci_counter.iseq(31) {
		call script im_make_pci32
	}
	if im_pci_counter.iseq(32) {
		stopbox stop "Limit exceeded."	///
			"Only 32 coordinates may be defined for each plot."
	}
    }
END

PROGRAM im_check_edit
BEGIN
    if main.lb_type_immediate.contains("scatteri") {
	if main.lb_im_sci_coord.iseq("1") {
		call script im_make_sci1
	}
	if main.lb_im_sci_coord.iseq("2") {
		call script im_make_sci2
	}
	if main.lb_im_sci_coord.iseq("3") {
		call script im_make_sci3
	}
	if main.lb_im_sci_coord.iseq("4") {
		call script im_make_sci4
	}
	if main.lb_im_sci_coord.iseq("5") {
		call script im_make_sci5
	}
	if main.lb_im_sci_coord.iseq("6") {
		call script im_make_sci6
	}
	if main.lb_im_sci_coord.iseq("7") {
		call script im_make_sci7
	}
	if main.lb_im_sci_coord.iseq("8") {
		call script im_make_sci8
	}
	if main.lb_im_sci_coord.iseq("9") {
		call script im_make_sci9
	}
	if main.lb_im_sci_coord.iseq("10") {
		call script im_make_sci10
	}
	if main.lb_im_sci_coord.iseq("11") {
		call script im_make_sci11
	}
	if main.lb_im_sci_coord.iseq("12") {
		call script im_make_sci12
	}
	if main.lb_im_sci_coord.iseq("13") {
		call script im_make_sci13
	}
	if main.lb_im_sci_coord.iseq("14") {
		call script im_make_sci14
	}
	if main.lb_im_sci_coord.iseq("15") {
		call script im_make_sci15
	}
	if main.lb_im_sci_coord.iseq("16") {
		call script im_make_sci16
	}
	if main.lb_im_sci_coord.iseq("17") {
		call script im_make_sci17
	}
	if main.lb_im_sci_coord.iseq("18") {
		call script im_make_sci18
	}
	if main.lb_im_sci_coord.iseq("19") {
		call script im_make_sci19
	}
	if main.lb_im_sci_coord.iseq("20") {
		call script im_make_sci20
	}
	if main.lb_im_sci_coord.iseq("21") {
		call script im_make_sci21
	}
	if main.lb_im_sci_coord.iseq("22") {
		call script im_make_sci22
	}
	if main.lb_im_sci_coord.iseq("23") {
		call script im_make_sci23
	}
	if main.lb_im_sci_coord.iseq("24") {
		call script im_make_sci24
	}
	if main.lb_im_sci_coord.iseq("25") {
		call script im_make_sci25
	}
	if main.lb_im_sci_coord.iseq("26") {
		call script im_make_sci26
	}
	if main.lb_im_sci_coord.iseq("27") {
		call script im_make_sci27
	}
	if main.lb_im_sci_coord.iseq("28") {
		call script im_make_sci28
	}
	if main.lb_im_sci_coord.iseq("29") {
		call script im_make_sci29
	}
	if main.lb_im_sci_coord.iseq("30") {
		call script im_make_sci30
	}
	if main.lb_im_sci_coord.iseq("31") {
		call script im_make_sci31
	}
	if main.lb_im_sci_coord.iseq("32") {
		call script im_make_sci32
	}
    }
    
    if main.lb_type_immediate.contains("pci") 		///
	| main.lb_type_immediate.contains("pcarrowi") 	///
    {
	if main.lb_im_pci_coord.iseq("1") {
		call script im_make_pci1
	}
	if main.lb_im_pci_coord.iseq("2") {
		call script im_make_pci2
	}
	if main.lb_im_pci_coord.iseq("3") {
		call script im_make_pci3
	}
	if main.lb_im_pci_coord.iseq("4") {
		call script im_make_pci4
	}
	if main.lb_im_pci_coord.iseq("5") {
		call script im_make_pci5
	}
	if main.lb_im_pci_coord.iseq("6") {
		call script im_make_pci6
	}
	if main.lb_im_pci_coord.iseq("7") {
		call script im_make_pci7
	}
	if main.lb_im_pci_coord.iseq("8") {
		call script im_make_pci8
	}
	if main.lb_im_pci_coord.iseq("9") {
		call script im_make_pci9
	}
	if main.lb_im_pci_coord.iseq("10") {
		call script im_make_pci10
	}
	if main.lb_im_pci_coord.iseq("11") {
		call script im_make_pci11
	}
	if main.lb_im_pci_coord.iseq("12") {
		call script im_make_pci12
	}
	if main.lb_im_pci_coord.iseq("13") {
		call script im_make_pci13
	}
	if main.lb_im_pci_coord.iseq("14") {
		call script im_make_pci14
	}
	if main.lb_im_pci_coord.iseq("15") {
		call script im_make_pci15
	}
	if main.lb_im_pci_coord.iseq("16") {
		call script im_make_pci16
	}
	if main.lb_im_pci_coord.iseq("17") {
		call script im_make_pci17
	}
	if main.lb_im_pci_coord.iseq("18") {
		call script im_make_pci18
	}
	if main.lb_im_pci_coord.iseq("19") {
		call script im_make_pci19
	}
	if main.lb_im_pci_coord.iseq("20") {
		call script im_make_pci20
	}
	if main.lb_im_pci_coord.iseq("21") {
		call script im_make_pci21
	}
	if main.lb_im_pci_coord.iseq("22") {
		call script im_make_pci22
	}
	if main.lb_im_pci_coord.iseq("23") {
		call script im_make_pci23
	}
	if main.lb_im_pci_coord.iseq("24") {
		call script im_make_pci24
	}
	if main.lb_im_pci_coord.iseq("25") {
		call script im_make_pci25
	}
	if main.lb_im_pci_coord.iseq("26") {
		call script im_make_pci26
	}
	if main.lb_im_pci_coord.iseq("27") {
		call script im_make_pci27
	}
	if main.lb_im_pci_coord.iseq("28") {
		call script im_make_pci28
	}
	if main.lb_im_pci_coord.iseq("29") {
		call script im_make_pci29
	}
	if main.lb_im_pci_coord.iseq("30") {
		call script im_make_pci30
	}
	if main.lb_im_pci_coord.iseq("31") {
		call script im_make_pci31
	}
	if main.lb_im_pci_coord.iseq("32") {
		call script im_make_pci32
	}
    }
END

PROGRAM im_check_delete
BEGIN
    if main.lb_type_immediate.contains("scatteri") {
	if main.lb_im_sci_coord.iseq("1") {
		call imSciDeleted1.settrue
		call imSci1.setstring ""
	}
	if main.lb_im_sci_coord.iseq("2") {
		call imSciDeleted2.settrue
		call imSci2.setstring ""
	}
	if main.lb_im_sci_coord.iseq("3") {
		call imSciDeleted3.settrue
		call imSci3.setstring ""
	}
	if main.lb_im_sci_coord.iseq("4") {
		call imSciDeleted4.settrue
		call imSci4.setstring ""
	}
	if main.lb_im_sci_coord.iseq("5") {
		call imSciDeleted5.settrue
		call imSci5.setstring ""
	}
	if main.lb_im_sci_coord.iseq("6") {
		call imSciDeleted6.settrue
		call imSci6.setstring ""
	}
	if main.lb_im_sci_coord.iseq("7") {
		call imSciDeleted7.settrue
		call imSci7.setstring ""
	}
	if main.lb_im_sci_coord.iseq("8") {
		call imSciDeleted8.settrue
		call imSci8.setstring ""
	}
	if main.lb_im_sci_coord.iseq("9") {
		call imSciDeleted9.settrue
		call imSci9.setstring ""
	}
	if main.lb_im_sci_coord.iseq("10") {
		call imSciDeleted10.settrue
		call imSci10.setstring ""
	}
	if main.lb_im_sci_coord.iseq("11") {
		call imSciDeleted11.settrue
		call imSci11.setstring ""
	}
	if main.lb_im_sci_coord.iseq("12") {
		call imSciDeleted12.settrue
		call imSci12.setstring ""
	}
	if main.lb_im_sci_coord.iseq("13") {
		call imSciDeleted13.settrue
		call imSci13.setstring ""
	}
	if main.lb_im_sci_coord.iseq("14") {
		call imSciDeleted14.settrue
		call imSci14.setstring ""
	}
	if main.lb_im_sci_coord.iseq("15") {
		call imSciDeleted15.settrue
		call imSci15.setstring ""
	}
	if main.lb_im_sci_coord.iseq("16") {
		call imSciDeleted16.settrue
		call imSci16.setstring ""
	}
	if main.lb_im_sci_coord.iseq("17") {
		call imSciDeleted17.settrue
		call imSci17.setstring ""
	}
	if main.lb_im_sci_coord.iseq("18") {
		call imSciDeleted18.settrue
		call imSci18.setstring ""
	}
	if main.lb_im_sci_coord.iseq("19") {
		call imSciDeleted19.settrue
		call imSci19.setstring ""
	}
	if main.lb_im_sci_coord.iseq("20") {
		call imSciDeleted20.settrue
		call imSci20.setstring ""
	}
	if main.lb_im_sci_coord.iseq("21") {
		call imSciDeleted21.settrue
		call imSci21.setstring ""
	}
	if main.lb_im_sci_coord.iseq("22") {
		call imSciDeleted22.settrue
		call imSci22.setstring ""
	}
	if main.lb_im_sci_coord.iseq("23") {
		call imSciDeleted23.settrue
		call imSci23.setstring ""
	}
	if main.lb_im_sci_coord.iseq("24") {
		call imSciDeleted24.settrue
		call imSci24.setstring ""
	}
	if main.lb_im_sci_coord.iseq("25") {
		call imSciDeleted25.settrue
		call imSci25.setstring ""
	}
	if main.lb_im_sci_coord.iseq("26") {
		call imSciDeleted26.settrue
		call imSci26.setstring ""
	}
	if main.lb_im_sci_coord.iseq("27") {
		call imSciDeleted27.settrue
		call imSci27.setstring ""
	}
	if main.lb_im_sci_coord.iseq("28") {
		call imSciDeleted28.settrue
		call imSci28.setstring ""
	}
	if main.lb_im_sci_coord.iseq("29") {
		call imSciDeleted29.settrue
		call imSci29.setstring ""
	}
	if main.lb_im_sci_coord.iseq("30") {
		call imSciDeleted30.settrue
		call imSci30.setstring ""
	}
	if main.lb_im_sci_coord.iseq("31") {
		call imSciDeleted31.settrue
		call imSci31.setstring ""
	}
	if main.lb_im_sci_coord.iseq("32") {
		call imSciDeleted32.settrue
		call imSci32.setstring ""
	}
	call program im_sci_process_list
    }
 
    if main.lb_type_immediate.contains("pci") 		///
	| main.lb_type_immediate.contains("pcarrowi") 	///
    {
	if main.lb_im_pci_coord.iseq("1") {
		call imPciDeleted1.settrue
		call imPci1.setstring ""
	}
	if main.lb_im_pci_coord.iseq("2") {
		call imPciDeleted2.settrue
		call imPci2.setstring ""
	}
	if main.lb_im_pci_coord.iseq("3") {
		call imPciDeleted3.settrue
		call imPci3.setstring ""
	}
	if main.lb_im_pci_coord.iseq("4") {
		call imPciDeleted4.settrue
		call imPci4.setstring ""
	}
	if main.lb_im_pci_coord.iseq("5") {
		call imPciDeleted5.settrue
		call imPci5.setstring ""
	}
	if main.lb_im_pci_coord.iseq("6") {
		call imPciDeleted6.settrue
		call imPci6.setstring ""
	}
	if main.lb_im_pci_coord.iseq("7") {
		call imPciDeleted7.settrue
		call imPci7.setstring ""
	}
	if main.lb_im_pci_coord.iseq("8") {
		call imPciDeleted8.settrue
		call imPci8.setstring ""
	}
	if main.lb_im_pci_coord.iseq("9") {
		call imPciDeleted9.settrue
		call imPci9.setstring ""
	}
	if main.lb_im_pci_coord.iseq("10") {
		call imPciDeleted10.settrue
		call imPci10.setstring ""
	}
	if main.lb_im_pci_coord.iseq("11") {
		call imPciDeleted11.settrue
		call imPci11.setstring ""
	}
	if main.lb_im_pci_coord.iseq("12") {
		call imPciDeleted12.settrue
		call imPci12.setstring ""
	}
	if main.lb_im_pci_coord.iseq("13") {
		call imPciDeleted13.settrue
		call imPci13.setstring ""
	}
	if main.lb_im_pci_coord.iseq("14") {
		call imPciDeleted14.settrue
		call imPci14.setstring ""
	}
	if main.lb_im_pci_coord.iseq("15") {
		call imPciDeleted15.settrue
		call imPci15.setstring ""
	}
	if main.lb_im_pci_coord.iseq("16") {
		call imPciDeleted16.settrue
		call imPci16.setstring ""
	}
	if main.lb_im_pci_coord.iseq("17") {
		call imPciDeleted17.settrue
		call imPci17.setstring ""
	}
	if main.lb_im_pci_coord.iseq("18") {
		call imPciDeleted18.settrue
		call imPci18.setstring ""
	}
	if main.lb_im_pci_coord.iseq("19") {
		call imPciDeleted19.settrue
		call imPci19.setstring ""
	}
	if main.lb_im_pci_coord.iseq("20") {
		call imPciDeleted20.settrue
		call imPci20.setstring ""
	}
	if main.lb_im_pci_coord.iseq("21") {
		call imPciDeleted21.settrue
		call imPci21.setstring ""
	}
	if main.lb_im_pci_coord.iseq("22") {
		call imPciDeleted22.settrue
		call imPci22.setstring ""
	}
	if main.lb_im_pci_coord.iseq("23") {
		call imPciDeleted23.settrue
		call imPci23.setstring ""
	}
	if main.lb_im_pci_coord.iseq("24") {
		call imPciDeleted24.settrue
		call imPci24.setstring ""
	}
	if main.lb_im_pci_coord.iseq("25") {
		call imPciDeleted25.settrue
		call imPci25.setstring ""
	}
	if main.lb_im_pci_coord.iseq("26") {
		call imPciDeleted26.settrue
		call imPci26.setstring ""
	}
	if main.lb_im_pci_coord.iseq("27") {
		call imPciDeleted27.settrue
		call imPci27.setstring ""
	}
	if main.lb_im_pci_coord.iseq("28") {
		call imPciDeleted28.settrue
		call imPci28.setstring ""
	}
	if main.lb_im_pci_coord.iseq("29") {
		call imPciDeleted29.settrue
		call imPci29.setstring ""
	}
	if main.lb_im_pci_coord.iseq("30") {
		call imPciDeleted30.settrue
		call imPci30.setstring ""
	}
	if main.lb_im_pci_coord.iseq("31") {
		call imPciDeleted31.settrue
		call imPci31.setstring ""
	}
	if main.lb_im_pci_coord.iseq("32") {
		call imPciDeleted32.settrue
		call imPci32.setstring ""
	}
	call program im_pci_process_list
    }
END


SCRIPT im_make_sci1
BEGIN
	create CHILD gr_tw_scatteri AS imScatter1
	imScatter1.setExitString imSciResult
	imScatter1.settitle "Define immediate plot coordinates and text"
	imScatter1.setExitAction "program checkImSci1"
END
PROGRAM checkImSci1
BEGIN
	call imSciResult.withvalue imSci1.setstring `"@"'
	call imSciDeleted1.setfalse
	if im_sci_counter.iseq(0) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci2
BEGIN
	create CHILD gr_tw_scatteri AS imScatter2
	imScatter2.setExitString imSciResult
	imScatter2.settitle "Define immediate plot coordinates and text"
	imScatter2.setExitAction "program checkImSci2"
END
PROGRAM checkImSci2
BEGIN
	call imSciResult.withvalue imSci2.setstring `"@"'
	call imSciDeleted2.setfalse
	if im_sci_counter.iseq(1) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci3
BEGIN
	create CHILD gr_tw_scatteri AS imScatter3
	imScatter3.setExitString imSciResult
	imScatter3.settitle "Define immediate plot coordinates and text"
	imScatter3.setExitAction "program checkImSci3"
END
PROGRAM checkImSci3
BEGIN
	call imSciResult.withvalue imSci3.setstring `"@"'
	call imSciDeleted3.setfalse
	if im_sci_counter.iseq(2) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci4
BEGIN
	create CHILD gr_tw_scatteri AS imScatter4
	imScatter4.setExitString imSciResult
	imScatter4.settitle "Define immediate plot coordinates and text"
	imScatter4.setExitAction "program checkImSci4"
END
PROGRAM checkImSci4
BEGIN
	call imSciResult.withvalue imSci4.setstring `"@"'
	call imSciDeleted4.setfalse
	if im_sci_counter.iseq(3) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci5
BEGIN
	create CHILD gr_tw_scatteri AS imScatter5
	imScatter5.setExitString imSciResult
	imScatter5.settitle "Define immediate plot coordinates and text"
	imScatter5.setExitAction "program checkImSci5"
END
PROGRAM checkImSci5
BEGIN
	call imSciResult.withvalue imSci5.setstring `"@"'
	call imSciDeleted5.setfalse
	if im_sci_counter.iseq(4) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci6
BEGIN
	create CHILD gr_tw_scatteri AS imScatter6
	imScatter6.setExitString imSciResult
	imScatter6.settitle "Define immediate plot coordinates and text"
	imScatter6.setExitAction "program checkImSci6"
END
PROGRAM checkImSci6
BEGIN
	call imSciResult.withvalue imSci6.setstring `"@"'
	call imSciDeleted6.setfalse
	if im_sci_counter.iseq(5) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci7
BEGIN
	create CHILD gr_tw_scatteri AS imScatter7
	imScatter7.setExitString imSciResult
	imScatter7.settitle "Define immediate plot coordinates and text"
	imScatter7.setExitAction "program checkImSci7"
END
PROGRAM checkImSci7
BEGIN
	call imSciResult.withvalue imSci7.setstring `"@"'
	call imSciDeleted7.setfalse
	if im_sci_counter.iseq(6) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci8
BEGIN
	create CHILD gr_tw_scatteri AS imScatter8
	imScatter8.setExitString imSciResult
	imScatter8.settitle "Define immediate plot coordinates and text"
	imScatter8.setExitAction "program checkImSci8"
END
PROGRAM checkImSci8
BEGIN
	call imSciResult.withvalue imSci8.setstring `"@"'
	call imSciDeleted8.setfalse
	if im_sci_counter.iseq(7) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci9
BEGIN
	create CHILD gr_tw_scatteri AS imScatter9
	imScatter9.setExitString imSciResult
	imScatter9.settitle "Define immediate plot coordinates and text"
	imScatter9.setExitAction "program checkImSci9"
END
PROGRAM checkImSci9
BEGIN
	call imSciResult.withvalue imSci9.setstring `"@"'
	call imSciDeleted9.setfalse
	if im_sci_counter.iseq(8) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci10
BEGIN
	create CHILD gr_tw_scatteri AS imScatter10
	imScatter10.setExitString imSciResult
	imScatter10.settitle "Define immediate plot coordinates and text"
	imScatter10.setExitAction "program checkImSci10"
END
PROGRAM checkImSci10
BEGIN
	call imSciResult.withvalue imSci10.setstring `"@"'
	call imSciDeleted10.setfalse
	if im_sci_counter.iseq(9) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci11
BEGIN
	create CHILD gr_tw_scatteri AS imScatter11
	imScatter11.setExitString imSciResult
	imScatter11.settitle "Define immediate plot coordinates and text"
	imScatter11.setExitAction "program checkImSci11"
END
PROGRAM checkImSci11
BEGIN
	call imSciResult.withvalue imSci11.setstring `"@"'
	call imSciDeleted11.setfalse
	if im_sci_counter.iseq(10) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci12
BEGIN
	create CHILD gr_tw_scatteri AS imScatter12
	imScatter12.setExitString imSciResult
	imScatter12.settitle "Define immediate plot coordinates and text"
	imScatter12.setExitAction "program checkImSci12"
END
PROGRAM checkImSci12
BEGIN
	call imSciResult.withvalue imSci12.setstring `"@"'
	call imSciDeleted12.setfalse
	if im_sci_counter.iseq(11) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci13
BEGIN
	create CHILD gr_tw_scatteri AS imScatter13
	imScatter13.setExitString imSciResult
	imScatter13.settitle "Define immediate plot coordinates and text"
	imScatter13.setExitAction "program checkImSci13"
END
PROGRAM checkImSci13
BEGIN
	call imSciResult.withvalue imSci13.setstring `"@"'
	call imSciDeleted13.setfalse
	if im_sci_counter.iseq(12) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci14
BEGIN
	create CHILD gr_tw_scatteri AS imScatter14
	imScatter14.setExitString imSciResult
	imScatter14.settitle "Define immediate plot coordinates and text"
	imScatter14.setExitAction "program checkImSci14"
END
PROGRAM checkImSci14
BEGIN
	call imSciResult.withvalue imSci14.setstring `"@"'
	call imSciDeleted14.setfalse
	if im_sci_counter.iseq(13) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci15
BEGIN
	create CHILD gr_tw_scatteri AS imScatter15
	imScatter15.setExitString imSciResult
	imScatter15.settitle "Define immediate plot coordinates and text"
	imScatter15.setExitAction "program checkImSci15"
END
PROGRAM checkImSci15
BEGIN
	call imSciResult.withvalue imSci15.setstring `"@"'
	call imSciDeleted15.setfalse
	if im_sci_counter.iseq(14) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci16
BEGIN
	create CHILD gr_tw_scatteri AS imScatter16
	imScatter16.setExitString imSciResult
	imScatter16.settitle "Define immediate plot coordinates and text"
	imScatter16.setExitAction "program checkImSci16"
END
PROGRAM checkImSci16
BEGIN
	call imSciResult.withvalue imSci16.setstring `"@"'
	call imSciDeleted16.setfalse
	if im_sci_counter.iseq(15) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci17
BEGIN
	create CHILD gr_tw_scatteri AS imScatter17
	imScatter17.setExitString imSciResult
	imScatter17.settitle "Define immediate plot coordinates and text"
	imScatter17.setExitAction "program checkImSci17"
END
PROGRAM checkImSci17
BEGIN
	call imSciResult.withvalue imSci17.setstring `"@"'
	call imSciDeleted17.setfalse
	if im_sci_counter.iseq(16) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci18
BEGIN
	create CHILD gr_tw_scatteri AS imScatter18
	imScatter18.setExitString imSciResult
	imScatter18.settitle "Define immediate plot coordinates and text"
	imScatter18.setExitAction "program checkImSci18"
END
PROGRAM checkImSci18
BEGIN
	call imSciResult.withvalue imSci18.setstring `"@"'
	call imSciDeleted18.setfalse
	if im_sci_counter.iseq(17) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci19
BEGIN
	create CHILD gr_tw_scatteri AS imScatter19
	imScatter19.setExitString imSciResult
	imScatter19.settitle "Define immediate plot coordinates and text"
	imScatter19.setExitAction "program checkImSci19"
END
PROGRAM checkImSci19
BEGIN
	call imSciResult.withvalue imSci19.setstring `"@"'
	call imSciDeleted19.setfalse
	if im_sci_counter.iseq(18) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci20
BEGIN
	create CHILD gr_tw_scatteri AS imScatter20
	imScatter20.setExitString imSciResult
	imScatter20.settitle "Define immediate plot coordinates and text"
	imScatter20.setExitAction "program checkImSci20"
END
PROGRAM checkImSci20
BEGIN
	call imSciResult.withvalue imSci20.setstring `"@"'
	call imSciDeleted20.setfalse
	if im_sci_counter.iseq(19) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci21
BEGIN
	create CHILD gr_tw_scatteri AS imScatter21
	imScatter21.setExitString imSciResult
	imScatter21.settitle "Define immediate plot coordinates and text"
	imScatter21.setExitAction "program checkImSci21"
END
PROGRAM checkImSci21
BEGIN
	call imSciResult.withvalue imSci21.setstring `"@"'
	call imSciDeleted21.setfalse
	if im_sci_counter.iseq(20) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci22
BEGIN
	create CHILD gr_tw_scatteri AS imScatter22
	imScatter22.setExitString imSciResult
	imScatter22.settitle "Define immediate plot coordinates and text"
	imScatter22.setExitAction "program checkImSci22"
END
PROGRAM checkImSci22
BEGIN
	call imSciResult.withvalue imSci22.setstring `"@"'
	call imSciDeleted22.setfalse
	if im_sci_counter.iseq(21) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci23
BEGIN
	create CHILD gr_tw_scatteri AS imScatter23
	imScatter23.setExitString imSciResult
	imScatter23.settitle "Define immediate plot coordinates and text"
	imScatter23.setExitAction "program checkImSci23"
END
PROGRAM checkImSci23
BEGIN
	call imSciResult.withvalue imSci23.setstring `"@"'
	call imSciDeleted23.setfalse
	if im_sci_counter.iseq(22) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci24
BEGIN
	create CHILD gr_tw_scatteri AS imScatter24
	imScatter24.setExitString imSciResult
	imScatter24.settitle "Define immediate plot coordinates and text"
	imScatter24.setExitAction "program checkImSci24"
END
PROGRAM checkImSci24
BEGIN
	call imSciResult.withvalue imSci24.setstring `"@"'
	call imSciDeleted24.setfalse
	if im_sci_counter.iseq(23) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci25
BEGIN
	create CHILD gr_tw_scatteri AS imScatter25
	imScatter25.setExitString imSciResult
	imScatter25.settitle "Define immediate plot coordinates and text"
	imScatter25.setExitAction "program checkImSci25"
END
PROGRAM checkImSci25
BEGIN
	call imSciResult.withvalue imSci25.setstring `"@"'
	call imSciDeleted25.setfalse
	if im_sci_counter.iseq(24) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci26
BEGIN
	create CHILD gr_tw_scatteri AS imScatter26
	imScatter26.setExitString imSciResult
	imScatter26.settitle "Define immediate plot coordinates and text"
	imScatter26.setExitAction "program checkImSci26"
END
PROGRAM checkImSci26
BEGIN
	call imSciResult.withvalue imSci26.setstring `"@"'
	call imSciDeleted26.setfalse
	if im_sci_counter.iseq(25) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci27
BEGIN
	create CHILD gr_tw_scatteri AS imScatter27
	imScatter27.setExitString imSciResult
	imScatter27.settitle "Define immediate plot coordinates and text"
	imScatter27.setExitAction "program checkImSci27"
END
PROGRAM checkImSci27
BEGIN
	call imSciResult.withvalue imSci27.setstring `"@"'
	call imSciDeleted27.setfalse
	if im_sci_counter.iseq(26) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci28
BEGIN
	create CHILD gr_tw_scatteri AS imScatter28
	imScatter28.setExitString imSciResult
	imScatter28.settitle "Define immediate plot coordinates and text"
	imScatter28.setExitAction "program checkImSci28"
END
PROGRAM checkImSci28
BEGIN
	call imSciResult.withvalue imSci28.setstring `"@"'
	call imSciDeleted28.setfalse
	if im_sci_counter.iseq(27) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci29
BEGIN
	create CHILD gr_tw_scatteri AS imScatter29
	imScatter29.setExitString imSciResult
	imScatter29.settitle "Define immediate plot coordinates and text"
	imScatter29.setExitAction "program checkImSci29"
END
PROGRAM checkImSci29
BEGIN
	call imSciResult.withvalue imSci29.setstring `"@"'
	call imSciDeleted29.setfalse
	if im_sci_counter.iseq(28) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci30
BEGIN
	create CHILD gr_tw_scatteri AS imScatter30
	imScatter30.setExitString imSciResult
	imScatter30.settitle "Define immediate plot coordinates and text"
	imScatter30.setExitAction "program checkImSci30"
END
PROGRAM checkImSci30
BEGIN
	call imSciResult.withvalue imSci30.setstring `"@"'
	call imSciDeleted30.setfalse
	if im_sci_counter.iseq(29) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci31
BEGIN
	create CHILD gr_tw_scatteri AS imScatter31
	imScatter31.setExitString imSciResult
	imScatter31.settitle "Define immediate plot coordinates and text"
	imScatter31.setExitAction "program checkImSci31"
END
PROGRAM checkImSci31
BEGIN
	call imSciResult.withvalue imSci31.setstring `"@"'
	call imSciDeleted31.setfalse
	if im_sci_counter.iseq(30) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_make_sci32
BEGIN
	create CHILD gr_tw_scatteri AS imScatter32
	imScatter32.setExitString imSciResult
	imScatter32.settitle "Define immediate plot coordinates and text"
	imScatter32.setExitAction "program checkImSci32"
END
PROGRAM checkImSci32
BEGIN
	call imSciResult.withvalue imSci32.setstring `"@"'
	call imSciDeleted32.setfalse
	if im_sci_counter.iseq(31) {
		call im_sci_counter.increment
	}
	call program im_sci_process_list
END

SCRIPT im_sci_clear_list
BEGIN
	main.lb_im_sci_coord.clearlist
	im_sci_coord_list.Arrdropall
	im_sci_coord_values.Arrdropall
END

PROGRAM im_sci_process_list
BEGIN	
	call script im_sci_clear_list
	if im_sci_counter.isge(1) {
		if imSciDeleted1 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted1 {
			call imSci1.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci1.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "1"  // row identity
		
		// setup for first definition only
		call main.lb_im_sci_coord.setvalue "1"
		call main.lb_im_sci_coord.withvalue main.lb_im_sci_coord.setvalue `"@"'
		call main.bu_im_delete.enable
		call main.bu_im_edit.enable
	}
	if im_sci_counter.isge(2) {
		if imSciDeleted2 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted2 {
			call imSci2.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci2.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "2"  // row identity
	}
	if im_sci_counter.isge(3) {
		if imSciDeleted3 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted3 {
			call imSci3.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci3.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "3"  // row identity
	}
	if im_sci_counter.isge(4) {
		if imSciDeleted4 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted4 {
			call imSci4.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci4.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "4"  // row identity
	}
	if im_sci_counter.isge(5) {
		if imSciDeleted5 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted5 {
			call imSci5.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci5.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "5"  // row identity
	}
	if im_sci_counter.isge(6) {
		if imSciDeleted6 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted6 {
			call imSci6.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci6.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "6"  // row identity
	}
	if im_sci_counter.isge(7) {
		if imSciDeleted7 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted7 {
			call imSci7.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci7.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "7"  // row identity
	}
	if im_sci_counter.isge(8) {
		if imSciDeleted8 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted8 {
			call imSci8.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci8.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "8"  // row identity
	}
	if im_sci_counter.isge(9) {
		if imSciDeleted9 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted9 {
			call imSci9.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci9.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "9"  // row identity
	}
	if im_sci_counter.isge(10) {
		if imSciDeleted10 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted10 {
			call imSci10.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci10.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "10"  // row identity
	}
	if im_sci_counter.isge(11) {
		if imSciDeleted11 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted11 {
			call imSci11.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci11.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "11"  // row identity
	}
	if im_sci_counter.isge(12) {
		if imSciDeleted12 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted12 {
			call imSci12.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci12.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "12"  // row identity
	}
	if im_sci_counter.isge(13) {
		if imSciDeleted13 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted13 {
			call imSci13.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci13.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "13"  // row identity
	}
	if im_sci_counter.isge(14) {
		if imSciDeleted14 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted14 {
			call imSci14.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci14.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "14"  // row identity
	}
	if im_sci_counter.isge(15) {
		if imSciDeleted15 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted15 {
			call imSci15.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci15.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "15"  // row identity
	}
	if im_sci_counter.isge(16) {
		if imSciDeleted16 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted16 {
			call imSci16.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci16.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "16"  // row identity
	}
	if im_sci_counter.isge(17) {
		if imSciDeleted17 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted17 {
			call imSci17.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci17.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "17"  // row identity
	}
	if im_sci_counter.isge(18) {
		if imSciDeleted18 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted18 {
			call imSci18.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci18.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "18"  // row identity
	}
	if im_sci_counter.isge(19) {
		if imSciDeleted19 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted19 {
			call imSci19.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci19.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "19"  // row identity
	}
	if im_sci_counter.isge(20) {
		if imSciDeleted20 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted20 {
			call imSci20.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci20.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "20"  // row identity
	}
	if im_sci_counter.isge(21) {
		if imSciDeleted21 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted21 {
			call imSci21.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci21.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "21"  // row identity
	}
	if im_sci_counter.isge(22) {
		if imSciDeleted22 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted22 {
			call imSci22.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci22.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "22"  // row identity
	}
	if im_sci_counter.isge(23) {
		if imSciDeleted23 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted23 {
			call imSci23.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci23.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "23"  // row identity
	}
	if im_sci_counter.isge(24) {
		if imSciDeleted24 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted24 {
			call imSci24.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci24.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "24"  // row identity
	}
	if im_sci_counter.isge(25) {
		if imSciDeleted25 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted25 {
			call imSci25.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci25.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "25"  // row identity
	}
	if im_sci_counter.isge(26) {
		if imSciDeleted26 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted26 {
			call imSci26.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci26.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "26"  // row identity
	}
	if im_sci_counter.isge(27) {
		if imSciDeleted27 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted27 {
			call imSci27.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci27.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "27"  // row identity
	}
	if im_sci_counter.isge(28) {
		if imSciDeleted28 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted28 {
			call imSci28.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci28.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "28"  // row identity
	}
	if im_sci_counter.isge(29) {
		if imSciDeleted29 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted29 {
			call imSci29.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci29.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "29"  // row identity
	}
	if im_sci_counter.isge(30) {
		if imSciDeleted30 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted30 {
			call imSci30.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci30.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "30"  // row identity
	}
	if im_sci_counter.isge(31) {
		if imSciDeleted31 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted31 {
			call imSci31.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci31.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "31"  // row identity
	}
	if im_sci_counter.isge(32) {
		if imSciDeleted32 {
			call main.lb_im_sci_coord.additem "<deleted>"
			call im_sci_coord_list.Arrpush "<deleted>"
		}
		if ! imSciDeleted32 {
			call imSci32.withvalue main.lb_im_sci_coord.additem `"@"'
			call imSci32.withvalue im_sci_coord_list.Arrpush `"@"'
		}
		call im_sci_coord_values.Arrpush "32"  // row identity
	}
END

SCRIPT im_make_pci1
BEGIN
	create CHILD gr_tw_pci AS imPaired1
	imPaired1.setExitString imPciResult
	imPaired1.settitle "Define immediate plot coordinates and text"
	imPaired1.setExitAction "program checkImPci1"
END
PROGRAM checkImPci1
BEGIN
	call imPciResult.withvalue imPci1.setstring `"@"'
	call imPciDeleted1.setfalse
	if im_pci_counter.iseq(0) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci2
BEGIN
	create CHILD gr_tw_pci AS imPaired2
	imPaired2.setExitString imPciResult
	imPaired2.settitle "Define immediate plot coordinates and text"
	imPaired2.setExitAction "program checkImPci2"
END
PROGRAM checkImPci2
BEGIN
	call imPciResult.withvalue imPci2.setstring `"@"'
	call imPciDeleted2.setfalse
	if im_pci_counter.iseq(1) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci3
BEGIN
	create CHILD gr_tw_pci AS imPaired3
	imPaired3.setExitString imPciResult
	imPaired3.settitle "Define immediate plot coordinates and text"
	imPaired3.setExitAction "program checkImPci3"
END
PROGRAM checkImPci3
BEGIN
	call imPciResult.withvalue imPci3.setstring `"@"'
	call imPciDeleted3.setfalse
	if im_pci_counter.iseq(2) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci4
BEGIN
	create CHILD gr_tw_pci AS imPaired4
	imPaired4.setExitString imPciResult
	imPaired4.settitle "Define immediate plot coordinates and text"
	imPaired4.setExitAction "program checkImPci4"
END
PROGRAM checkImPci4
BEGIN
	call imPciResult.withvalue imPci4.setstring `"@"'
	call imPciDeleted4.setfalse
	if im_pci_counter.iseq(3) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci5
BEGIN
	create CHILD gr_tw_pci AS imPaired5
	imPaired5.setExitString imPciResult
	imPaired5.settitle "Define immediate plot coordinates and text"
	imPaired5.setExitAction "program checkImPci5"
END
PROGRAM checkImPci5
BEGIN
	call imPciResult.withvalue imPci5.setstring `"@"'
	call imPciDeleted5.setfalse
	if im_pci_counter.iseq(4) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci6
BEGIN
	create CHILD gr_tw_pci AS imPaired6
	imPaired6.setExitString imPciResult
	imPaired6.settitle "Define immediate plot coordinates and text"
	imPaired6.setExitAction "program checkImPci6"
END
PROGRAM checkImPci6
BEGIN
	call imPciResult.withvalue imPci6.setstring `"@"'
	call imPciDeleted6.setfalse
	if im_pci_counter.iseq(5) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci7
BEGIN
	create CHILD gr_tw_pci AS imPaired7
	imPaired7.setExitString imPciResult
	imPaired7.settitle "Define immediate plot coordinates and text"
	imPaired7.setExitAction "program checkImPci7"
END
PROGRAM checkImPci7
BEGIN
	call imPciResult.withvalue imPci7.setstring `"@"'
	call imPciDeleted7.setfalse
	if im_pci_counter.iseq(6) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci8
BEGIN
	create CHILD gr_tw_pci AS imPaired8
	imPaired8.setExitString imPciResult
	imPaired8.settitle "Define immediate plot coordinates and text"
	imPaired8.setExitAction "program checkImPci8"
END
PROGRAM checkImPci8
BEGIN
	call imPciResult.withvalue imPci8.setstring `"@"'
	call imPciDeleted8.setfalse
	if im_pci_counter.iseq(7) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci9
BEGIN
	create CHILD gr_tw_pci AS imPaired9
	imPaired9.setExitString imPciResult
	imPaired9.settitle "Define immediate plot coordinates and text"
	imPaired9.setExitAction "program checkImPci9"
END
PROGRAM checkImPci9
BEGIN
	call imPciResult.withvalue imPci9.setstring `"@"'
	call imPciDeleted9.setfalse
	if im_pci_counter.iseq(8) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci10
BEGIN
	create CHILD gr_tw_pci AS imPaired10
	imPaired10.setExitString imPciResult
	imPaired10.settitle "Define immediate plot coordinates and text"
	imPaired10.setExitAction "program checkImPci10"
END
PROGRAM checkImPci10
BEGIN
	call imPciResult.withvalue imPci10.setstring `"@"'
	call imPciDeleted10.setfalse
	if im_pci_counter.iseq(9) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci11
BEGIN
	create CHILD gr_tw_pci AS imPaired11
	imPaired11.setExitString imPciResult
	imPaired11.settitle "Define immediate plot coordinates and text"
	imPaired11.setExitAction "program checkImPci11"
END
PROGRAM checkImPci11
BEGIN
	call imPciResult.withvalue imPci11.setstring `"@"'
	call imPciDeleted11.setfalse
	if im_pci_counter.iseq(10) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci12
BEGIN
	create CHILD gr_tw_pci AS imPaired12
	imPaired12.setExitString imPciResult
	imPaired12.settitle "Define immediate plot coordinates and text"
	imPaired12.setExitAction "program checkImPci12"
END
PROGRAM checkImPci12
BEGIN
	call imPciResult.withvalue imPci12.setstring `"@"'
	call imPciDeleted12.setfalse
	if im_pci_counter.iseq(11) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci13
BEGIN
	create CHILD gr_tw_pci AS imPaired13
	imPaired13.setExitString imPciResult
	imPaired13.settitle "Define immediate plot coordinates and text"
	imPaired13.setExitAction "program checkImPci13"
END
PROGRAM checkImPci13
BEGIN
	call imPciResult.withvalue imPci13.setstring `"@"'
	call imPciDeleted13.setfalse
	if im_pci_counter.iseq(12) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci14
BEGIN
	create CHILD gr_tw_pci AS imPaired14
	imPaired14.setExitString imPciResult
	imPaired14.settitle "Define immediate plot coordinates and text"
	imPaired14.setExitAction "program checkImPci14"
END
PROGRAM checkImPci14
BEGIN
	call imPciResult.withvalue imPci14.setstring `"@"'
	call imPciDeleted14.setfalse
	if im_pci_counter.iseq(13) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci15
BEGIN
	create CHILD gr_tw_pci AS imPaired15
	imPaired15.setExitString imPciResult
	imPaired15.settitle "Define immediate plot coordinates and text"
	imPaired15.setExitAction "program checkImPci15"
END
PROGRAM checkImPci15
BEGIN
	call imPciResult.withvalue imPci15.setstring `"@"'
	call imPciDeleted15.setfalse
	if im_pci_counter.iseq(14) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci16
BEGIN
	create CHILD gr_tw_pci AS imPaired16
	imPaired16.setExitString imPciResult
	imPaired16.settitle "Define immediate plot coordinates and text"
	imPaired16.setExitAction "program checkImPci16"
END
PROGRAM checkImPci16
BEGIN
	call imPciResult.withvalue imPci16.setstring `"@"'
	call imPciDeleted16.setfalse
	if im_pci_counter.iseq(15) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci17
BEGIN
	create CHILD gr_tw_pci AS imPaired17
	imPaired17.setExitString imPciResult
	imPaired17.settitle "Define immediate plot coordinates and text"
	imPaired17.setExitAction "program checkImPci17"
END
PROGRAM checkImPci17
BEGIN
	call imPciResult.withvalue imPci17.setstring `"@"'
	call imPciDeleted17.setfalse
	if im_pci_counter.iseq(16) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci18
BEGIN
	create CHILD gr_tw_pci AS imPaired18
	imPaired18.setExitString imPciResult
	imPaired18.settitle "Define immediate plot coordinates and text"
	imPaired18.setExitAction "program checkImPci18"
END
PROGRAM checkImPci18
BEGIN
	call imPciResult.withvalue imPci18.setstring `"@"'
	call imPciDeleted18.setfalse
	if im_pci_counter.iseq(17) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci19
BEGIN
	create CHILD gr_tw_pci AS imPaired19
	imPaired19.setExitString imPciResult
	imPaired19.settitle "Define immediate plot coordinates and text"
	imPaired19.setExitAction "program checkImPci19"
END
PROGRAM checkImPci19
BEGIN
	call imPciResult.withvalue imPci19.setstring `"@"'
	call imPciDeleted19.setfalse
	if im_pci_counter.iseq(18) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci20
BEGIN
	create CHILD gr_tw_pci AS imPaired20
	imPaired20.setExitString imPciResult
	imPaired20.settitle "Define immediate plot coordinates and text"
	imPaired20.setExitAction "program checkImPci20"
END
PROGRAM checkImPci20
BEGIN
	call imPciResult.withvalue imPci20.setstring `"@"'
	call imPciDeleted20.setfalse
	if im_pci_counter.iseq(19) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci21
BEGIN
	create CHILD gr_tw_pci AS imPaired21
	imPaired21.setExitString imPciResult
	imPaired21.settitle "Define immediate plot coordinates and text"
	imPaired21.setExitAction "program checkImPci21"
END
PROGRAM checkImPci21
BEGIN
	call imPciResult.withvalue imPci21.setstring `"@"'
	call imPciDeleted21.setfalse
	if im_pci_counter.iseq(20) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci22
BEGIN
	create CHILD gr_tw_pci AS imPaired22
	imPaired22.setExitString imPciResult
	imPaired22.settitle "Define immediate plot coordinates and text"
	imPaired22.setExitAction "program checkImPci22"
END
PROGRAM checkImPci22
BEGIN
	call imPciResult.withvalue imPci22.setstring `"@"'
	call imPciDeleted22.setfalse
	if im_pci_counter.iseq(21) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci23
BEGIN
	create CHILD gr_tw_pci AS imPaired23
	imPaired23.setExitString imPciResult
	imPaired23.settitle "Define immediate plot coordinates and text"
	imPaired23.setExitAction "program checkImPci23"
END
PROGRAM checkImPci23
BEGIN
	call imPciResult.withvalue imPci23.setstring `"@"'
	call imPciDeleted23.setfalse
	if im_pci_counter.iseq(22) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci24
BEGIN
	create CHILD gr_tw_pci AS imPaired24
	imPaired24.setExitString imPciResult
	imPaired24.settitle "Define immediate plot coordinates and text"
	imPaired24.setExitAction "program checkImPci24"
END
PROGRAM checkImPci24
BEGIN
	call imPciResult.withvalue imPci24.setstring `"@"'
	call imPciDeleted24.setfalse
	if im_pci_counter.iseq(23) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci25
BEGIN
	create CHILD gr_tw_pci AS imPaired25
	imPaired25.setExitString imPciResult
	imPaired25.settitle "Define immediate plot coordinates and text"
	imPaired25.setExitAction "program checkImPci25"
END
PROGRAM checkImPci25
BEGIN
	call imPciResult.withvalue imPci25.setstring `"@"'
	call imPciDeleted25.setfalse
	if im_pci_counter.iseq(24) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci26
BEGIN
	create CHILD gr_tw_pci AS imPaired26
	imPaired26.setExitString imPciResult
	imPaired26.settitle "Define immediate plot coordinates and text"
	imPaired26.setExitAction "program checkImPci26"
END
PROGRAM checkImPci26
BEGIN
	call imPciResult.withvalue imPci26.setstring `"@"'
	call imPciDeleted26.setfalse
	if im_pci_counter.iseq(25) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci27
BEGIN
	create CHILD gr_tw_pci AS imPaired27
	imPaired27.setExitString imPciResult
	imPaired27.settitle "Define immediate plot coordinates and text"
	imPaired27.setExitAction "program checkImPci27"
END
PROGRAM checkImPci27
BEGIN
	call imPciResult.withvalue imPci27.setstring `"@"'
	call imPciDeleted27.setfalse
	if im_pci_counter.iseq(26) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci28
BEGIN
	create CHILD gr_tw_pci AS imPaired28
	imPaired28.setExitString imPciResult
	imPaired28.settitle "Define immediate plot coordinates and text"
	imPaired28.setExitAction "program checkImPci28"
END
PROGRAM checkImPci28
BEGIN
	call imPciResult.withvalue imPci28.setstring `"@"'
	call imPciDeleted28.setfalse
	if im_pci_counter.iseq(27) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci29
BEGIN
	create CHILD gr_tw_pci AS imPaired29
	imPaired29.setExitString imPciResult
	imPaired29.settitle "Define immediate plot coordinates and text"
	imPaired29.setExitAction "program checkImPci29"
END
PROGRAM checkImPci29
BEGIN
	call imPciResult.withvalue imPci29.setstring `"@"'
	call imPciDeleted29.setfalse
	if im_pci_counter.iseq(28) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci30
BEGIN
	create CHILD gr_tw_pci AS imPaired30
	imPaired30.setExitString imPciResult
	imPaired30.settitle "Define immediate plot coordinates and text"
	imPaired30.setExitAction "program checkImPci30"
END
PROGRAM checkImPci30
BEGIN
	call imPciResult.withvalue imPci30.setstring `"@"'
	call imPciDeleted30.setfalse
	if im_pci_counter.iseq(29) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci31
BEGIN
	create CHILD gr_tw_pci AS imPaired31
	imPaired31.setExitString imPciResult
	imPaired31.settitle "Define immediate plot coordinates and text"
	imPaired31.setExitAction "program checkImPci31"
END
PROGRAM checkImPci31
BEGIN
	call imPciResult.withvalue imPci31.setstring `"@"'
	call imPciDeleted31.setfalse
	if im_pci_counter.iseq(30) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_make_pci32
BEGIN
	create CHILD gr_tw_pci AS imPaired32
	imPaired32.setExitString imPciResult
	imPaired32.settitle "Define immediate plot coordinates and text"
	imPaired32.setExitAction "program checkImPci32"
END
PROGRAM checkImPci32
BEGIN
	call imPciResult.withvalue imPci32.setstring `"@"'
	call imPciDeleted32.setfalse
	if im_pci_counter.iseq(31) {
		call im_pci_counter.increment
	}
	call program im_pci_process_list
END

SCRIPT im_pci_clear_list
BEGIN
	main.lb_im_pci_coord.clearlist
	im_pci_coord_list.Arrdropall
	im_pci_coord_values.Arrdropall
END

PROGRAM im_pci_process_list
BEGIN	
	call script im_pci_clear_list
	if im_pci_counter.isge(1) {
		if imPciDeleted1 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted1 {
			call imPci1.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci1.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "1"  // row identity
		
		// setup for first definition only
		call main.lb_im_pci_coord.setvalue "1"
		call main.lb_im_pci_coord.withvalue main.lb_im_pci_coord.setvalue `"@"'
		call main.bu_im_delete.enable
		call main.bu_im_edit.enable
	}
	if im_pci_counter.isge(2) {
		if imPciDeleted2 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted2 {
			call imPci2.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci2.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "2"  // row identity
	}
	if im_pci_counter.isge(3) {
		if imPciDeleted3 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted3 {
			call imPci3.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci3.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "3"  // row identity
	}
	if im_pci_counter.isge(4) {
		if imPciDeleted4 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted4 {
			call imPci4.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci4.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "4"  // row identity
	}
	if im_pci_counter.isge(5) {
		if imPciDeleted5 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted5 {
			call imPci5.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci5.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "5"  // row identity
	}
	if im_pci_counter.isge(6) {
		if imPciDeleted6 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted6 {
			call imPci6.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci6.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "6"  // row identity
	}
	if im_pci_counter.isge(7) {
		if imPciDeleted7 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted7 {
			call imPci7.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci7.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "7"  // row identity
	}
	if im_pci_counter.isge(8) {
		if imPciDeleted8 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted8 {
			call imPci8.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci8.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "8"  // row identity
	}
	if im_pci_counter.isge(9) {
		if imPciDeleted9 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted9 {
			call imPci9.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci9.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "9"  // row identity
	}
	if im_pci_counter.isge(10) {
		if imPciDeleted10 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted10 {
			call imPci10.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci10.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "10"  // row identity
	}
	if im_pci_counter.isge(11) {
		if imPciDeleted11 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted11 {
			call imPci11.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci11.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "11"  // row identity
	}
	if im_pci_counter.isge(12) {
		if imPciDeleted12 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted12 {
			call imPci12.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci12.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "12"  // row identity
	}
	if im_pci_counter.isge(13) {
		if imPciDeleted13 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted13 {
			call imPci13.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci13.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "13"  // row identity
	}
	if im_pci_counter.isge(14) {
		if imPciDeleted14 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted14 {
			call imPci14.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci14.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "14"  // row identity
	}
	if im_pci_counter.isge(15) {
		if imPciDeleted15 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted15 {
			call imPci15.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci15.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "15"  // row identity
	}
	if im_pci_counter.isge(16) {
		if imPciDeleted16 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted16 {
			call imPci16.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci16.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "16"  // row identity
	}
	if im_pci_counter.isge(17) {
		if imPciDeleted17 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted17 {
			call imPci17.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci17.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "17"  // row identity
	}
	if im_pci_counter.isge(18) {
		if imPciDeleted18 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted18 {
			call imPci18.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci18.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "18"  // row identity
	}
	if im_pci_counter.isge(19) {
		if imPciDeleted19 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted19 {
			call imPci19.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci19.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "19"  // row identity
	}
	if im_pci_counter.isge(20) {
		if imPciDeleted20 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted20 {
			call imPci20.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci20.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "20"  // row identity
	}
	if im_pci_counter.isge(21) {
		if imPciDeleted21 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted21 {
			call imPci21.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci21.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "21"  // row identity
	}
	if im_pci_counter.isge(22) {
		if imPciDeleted22 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted22 {
			call imPci22.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci22.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "22"  // row identity
	}
	if im_pci_counter.isge(23) {
		if imPciDeleted23 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted23 {
			call imPci23.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci23.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "23"  // row identity
	}
	if im_pci_counter.isge(24) {
		if imPciDeleted24 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted24 {
			call imPci24.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci24.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "24"  // row identity
	}
	if im_pci_counter.isge(25) {
		if imPciDeleted25 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted25 {
			call imPci25.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci25.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "25"  // row identity
	}
	if im_pci_counter.isge(26) {
		if imPciDeleted26 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted26 {
			call imPci26.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci26.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "26"  // row identity
	}
	if im_pci_counter.isge(27) {
		if imPciDeleted27 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted27 {
			call imPci27.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci27.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "27"  // row identity
	}
	if im_pci_counter.isge(28) {
		if imPciDeleted28 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted28 {
			call imPci28.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci28.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "28"  // row identity
	}
	if im_pci_counter.isge(29) {
		if imPciDeleted29 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted29 {
			call imPci29.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci29.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "29"  // row identity
	}
	if im_pci_counter.isge(30) {
		if imPciDeleted30 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted30 {
			call imPci30.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci30.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "30"  // row identity
	}
	if im_pci_counter.isge(31) {
		if imPciDeleted31 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted31 {
			call imPci31.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci31.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "31"  // row identity
	}
	if im_pci_counter.isge(32) {
		if imPciDeleted32 {
			call main.lb_im_pci_coord.additem "<deleted>"
			call im_pci_coord_list.Arrpush "<deleted>"
		}
		if ! imPciDeleted32 {
			call imPci32.withvalue main.lb_im_pci_coord.additem `"@"'
			call imPci32.withvalue im_pci_coord_list.Arrpush `"@"'
		}
		call im_pci_coord_values.Arrpush "32"  // row identity
	}
END

SCRIPT show_im_marker_dialog
BEGIN
	create CHILD gr_im_marker_options AS imMarkers, allowsubmit
	imMarkers.setExitString imMarkerResults
	imMarkers.settitle "Marker properties"
	imMarkers.setExitAction "program checkImMarkerResults"
	imMarkers.setSubmitAction "program imMarkerSubmit"
END
PROGRAM checkImMarkerResults
BEGIN
	if imMarkerResults.iseq("") {
		call main.bu_im_marker.setlabel "Marker properties  "
	}
	if imMarkerResults.isneq("") {
		call main.bu_im_marker.setlabel "Marker properties *"
	}
END
PROGRAM imMarkerSubmit
BEGIN
	call program checkImMarkerResults
	call Submit
END

SCRIPT show_im_line_dialog
BEGIN
	create CHILD gr_line_options AS imLines, allowsubmit
	imLines.setExitString imLineResults
	imLines.settitle "Line properties"
	imLines.setExitAction "program checkImLineResults"
	imLines.setSubmitAction "program imLineSubmit"
END
PROGRAM checkImLineResults
BEGIN
	if imLineResults.iseq("") {
		call main.bu_im_line.setlabel "Line properties  "
	}
	if imLineResults.isneq("") {
		call main.bu_im_line.setlabel "Line properties *"
	}
END
PROGRAM imLineSubmit
BEGIN
	call program checkImLineResults
	call Submit
END

SCRIPT show_im_pcspike_dialog
BEGIN
	create CHILD gr_pcline_options AS imSpikes, allowsubmit
	imSpikes.setExitString imSpikeResults
	imSpikes.settitle "Paired-coordinate line properties"
	imSpikes.setExitAction "program checkImSpikeResults"
	imSpikes.setSubmitAction "program imSpikeSubmit"
END
PROGRAM checkImSpikeResults
BEGIN
	if imSpikeResults.iseq("") {
		call main.bu_im_pcspike.setlabel "Line properties  "
	}
	if imSpikeResults.isneq("") {
		call main.bu_im_pcspike.setlabel "Line properties *"
	}
END
PROGRAM imSpikeSubmit
BEGIN
	call program checkImSpikeResults
	call Submit
END

SCRIPT show_im_pcarrow_dialog
BEGIN
	create CHILD gr_im_pcarrow_options AS imArrow, allowsubmit
	imArrow.setExitString imArrowResults
	imArrow.settitle "Paired-coordinate arrowhead properties"
	imArrow.setExitAction "program checkImArrowResults"
	imArrow.setSubmitAction "program imArrowSubmit"
END
PROGRAM checkImArrowResults
BEGIN
	if imArrowResults.iseq("") {
		call main.bu_im_pcarrow.setlabel "Arrowhead properties  "
	}
	if imArrowResults.isneq("") {
		call main.bu_im_pcarrow.setlabel "Arrowhead properties *"
	}
END
PROGRAM imArrowSubmit
BEGIN
	call program checkImArrowResults
	call Submit
END

SCRIPT show_im_pcmarker_dialog
BEGIN
	create CHILD gr_im_pcmarker_options AS imPcMarker, allowsubmit
	imPcMarker.setExitString imPcMarkerResults
	imPcMarker.settitle "Paired-coordinate marker properties"
	imPcMarker.setExitAction "program checkImPcMarkerResults"
	imPcMarker.setSubmitAction "program imPcMarkerSubmit"
END
PROGRAM checkImPcMarkerResults
BEGIN
	if imPcMarkerResults.iseq("") {
		call main.bu_im_pcmarker.setlabel "Marker properties  "
	}
	if imPcMarkerResults.isneq("") {
		call main.bu_im_pcmarker.setlabel "Marker properties *"
	}
END
PROGRAM imPcMarkerSubmit
BEGIN
	call program checkImPcMarkerResults
	call Submit
END

//*****************************************************************************

PROGRAM show_adv_weight_dialog
BEGIN
	call create CHILD weights AS advWeightDialog
	call advWeightDialog.setExitString advWeights
	call advWeightDialog.settitle "Weights"
	call advWeightDialog.setExitAction "program checkAdvWeights"
	call advWeightDialog.setSubmitAction "program advWeightSubmit"
	if main.lb_type_advanced.contains("lpoly") {
		call advWeightDialog.callthru "script weights_setLayout_fa"
	}
	else {
		call advWeightDialog.callthru "script weights_setLayout_fpa"
	}		
END
PROGRAM checkAdvWeights
BEGIN
	if advWeights.iseq("") {
		call main.bu_adv_weight.setlabel "Weights  "
	}
	else {
		call main.bu_adv_weight.setlabel "Weights *"
	}
END
PROGRAM advWeightSubmit
BEGIN
	call program checkAdvWeights
	call Submit
END

SCRIPT show_adv_tsline_dialog
BEGIN
	create CHILD gr_line_options AS advTsline, allowsubmit
	advTsline.setExitString advTslineResults
	advTsline.settitle "Time-series line properties"
	advTsline.setExitAction "program checkAdvTslineResults"
	advTsline.setSubmitAction "program advTslineSubmit"
END
PROGRAM checkAdvTslineResults
BEGIN
	if advTslineResults.iseq("") {
		call main.bu_adv_tsline.setlabel "Line properties  "
	}
	if advTslineResults.isneq("") {
		call main.bu_adv_tsline.setlabel "Line properties *"
	}
END
PROGRAM advTslineSubmit
BEGIN
	call program checkAdvTslineResults
	call Submit
END

SCRIPT show_adv_mband_dialog
BEGIN
	create CHILD gr_line_options AS advMband, allowsubmit
	advMband.setExitString advMbandResults
	advMband.settitle "Median-band line properties"
	advMband.setExitAction "program checkAdvMbandResults"
	advMband.setSubmitAction "program advMbandSubmit"
END
PROGRAM checkAdvMbandResults
BEGIN
	if advMbandResults.iseq("") {
		call main.bu_adv_mband.setlabel "Line properties  "
	}
	if advMbandResults.isneq("") {
		call main.bu_adv_mband.setlabel "Line properties *"
	}
END
PROGRAM advMbandSubmit
BEGIN
	call program checkAdvMbandResults
	call Submit
END

SCRIPT show_adv_lowess_dialog
BEGIN
	create CHILD gr_lowess_options AS advLowess, allowsubmit
	advLowess.setExitString advLowessResults
	advLowess.settitle "Lowess options"
	advLowess.setExitAction "program checkAdvLowessResults"
	advLowess.setSubmitAction "program advLowessSubmit"
END
PROGRAM checkAdvLowessResults
BEGIN
	if advLowessResults.iseq("") {
		call main.bu_adv_lowess.setlabel "Lowess options  "
	}
	if advLowessResults.isneq("") {
		call main.bu_adv_lowess.setlabel "Lowess options *"
	}
END
PROGRAM advLowessSubmit
BEGIN
	call program checkAdvLowessResults
	call Submit
END

SCRIPT show_adv_lowess_line_dialog
BEGIN
	create CHILD gr_line_options AS advLowessLine, allowsubmit
	advLowessLine.setExitString advLowessLineResults
	advLowessLine.settitle "Lowess line properties"
	advLowessLine.setExitAction "program checkAdvLowessLineResults"
	advLowessLine.setSubmitAction "program advLowessLineSubmit "
END
PROGRAM checkAdvLowessLineResults
BEGIN
	if advLowessLineResults.iseq("") {
		call main.bu_adv_lowess_line.setlabel "Line properties  "
	}
	if advLowessLineResults.isneq("") {
		call main.bu_adv_lowess_line.setlabel "Line properties *"
	}
END
PROGRAM advLowessLineSubmit
BEGIN
	call program checkAdvLowessLineResults
	call Submit
END

SCRIPT show_adv_kdensity_dialog
BEGIN
	create CHILD gr_kdensity_options AS advKdensity, allowsubmit
	advKdensity.setExitString advKdensityResults
	advKdensity.settitle "Kernel density options"
	advKdensity.setExitAction "program checkAdvKdensityResults"
	advKdensity.setSubmitAction "program advKdensitySubmit"
END
PROGRAM checkAdvKdensityResults
BEGIN
	if advKdensityResults.iseq("") {
		call main.bu_adv_kdensity.setlabel "Kernel options  "
	}
	if advKdensityResults.isneq("") {
		call main.bu_adv_kdensity.setlabel "Kernel options *"
	}
END
PROGRAM advKdensitySubmit
BEGIN
	call program checkAdvKdensityResults
	call Submit
END

SCRIPT show_adv_kdensity_line_dialog
BEGIN
	create CHILD gr_line_options AS advKdensityLine, allowsubmit
	advKdensityLine.setExitString advKdensityLineResults
	advKdensityLine.settitle "Kernel density line properties"
	advKdensityLine.setExitAction "program checkAdvKdensityLineResults"
	advKdensityLine.setSubmitAction "program advKdensityLineSubmit"
END
PROGRAM checkAdvKdensityLineResults
BEGIN
	if advKdensityLineResults.iseq("") {
		call main.bu_adv_kdensity_line.setlabel "Line properties  "
	}
	if advKdensityLineResults.isneq("") {
		call main.bu_adv_kdensity_line.setlabel "Line properties *"
	}
END
PROGRAM advKdensityLineSubmit
BEGIN
	call program checkAdvKdensityLineResults
	call Submit
END

PROGRAM show_adv_histogram_dialog
BEGIN
	call create CHILD gr_histogram_options AS advHistogram, allowsubmit
	call advHistogram.setExitString advHistogramResults
	call advHistogram.settitle "Histogram options"
	call advHistogram.setExitAction "program checkAdvHistogramResults"
	call advHistogram.setSubmitAction "program advHistogramSubmit"
	if main.rb_adv_hist_cont {
		call advHistogram.callthru "script gr_histogram_setContinuousOn"
	}
	if main.rb_adv_hist_discrete {
		call advHistogram.callthru "script gr_histogram_setDiscreteOn"
	}
END
PROGRAM checkAdvHistogramResults
BEGIN
	if advHistogramResults.iseq("") {
		call main.bu_adv_histogram.setlabel "Histogram options  "
	}
	if advHistogramResults.isneq("") {
		call main.bu_adv_histogram.setlabel "Histogram options *"
	}
END
PROGRAM advHistogramSubmit
BEGIN
	call program checkAdvHistogramResults
	call Submit
END

SCRIPT show_adv_histogram_bar_dialog
BEGIN
	create CHILD gr_bar_options AS advHistogramBar, allowsubmit
	advHistogramBar.setExitString advHistogramBarResults
	advHistogramBar.settitle "Histogram bar properties"
	advHistogramBar.setExitAction "program checkAdvHistogramBarResults"
	advHistogramBar.setSubmitAction "program advHistogramBarSubmit"
	advHistogramBar.callthru "script gr_bar_setHistogramOn"
END
PROGRAM checkAdvHistogramBarResults
BEGIN
	if advHistogramBarResults.iseq("") {
		call main.bu_adv_histogram_bar.setlabel "Bar properties  "
	}
	if advHistogramBarResults.isneq("") {
		call main.bu_adv_histogram_bar.setlabel "Bar properties *"
	}
END
PROGRAM advHistogramBarSubmit
BEGIN
	call program checkAdvHistogramBarResults
	call Submit
END

SCRIPT show_adv_locpoly_dialog
BEGIN
	create CHILD gr_locpoly_options AS advLocpoly, allowsubmit
	advLocpoly.setExitString advLocpolyResults
	advLocpoly.settitle "Local polynomial options"
	advLocpoly.setExitAction "program checkAdvLocpolyResults"
	advLocpoly.setSubmitAction "program advLocpolySubmit"
END
PROGRAM checkAdvLocpolyResults
BEGIN
	if advLocpolyResults.iseq("") {
		call main.bu_adv_locpoly.setlabel "Options  "
	}
	if advLocpolyResults.isneq("") {
		call main.bu_adv_locpoly.setlabel "Options *"
	}
END
PROGRAM advLocpolySubmit
BEGIN
	call program checkAdvLocpolyResults
	call Submit
END

SCRIPT show_adv_locpolyci_dialog
BEGIN
	create CHILD gr_locpolyci_options AS advLocpolyCi, allowsubmit
	advLocpolyCi.setExitString advLocpolyCiResults
	advLocpolyCi.settitle "Local polynomial options with CI's"
	advLocpolyCi.setExitAction "program checkAdvLocpolyCiResults"
	advLocpolyCi.setSubmitAction "program advLocpolyCiSubmit"
END
PROGRAM checkAdvLocpolyCiResults
BEGIN
	if advLocpolyCiResults.iseq("") {
		call main.bu_adv_locpolyci.setlabel "Options  "
	}
	if advLocpolyCiResults.isneq("") {
		call main.bu_adv_locpolyci.setlabel "Options *"
	}
END
PROGRAM advLocpolyCiSubmit
BEGIN
	call program checkAdvLocpolyCiResults
	call Submit
END

SCRIPT show_adv_function_dialog
BEGIN
	create CHILD gr_function_options AS advFunction, allowsubmit
	advFunction.setExitString advFunctionResults
	advFunction.settitle "Advanced function options"
	advFunction.setExitAction "program checkAdvFunctionResults"
	advFunction.setSubmitAction "program advFunctionSubmit "
END
PROGRAM checkAdvFunctionResults
BEGIN
	if advFunctionResults.iseq("") {
		call main.bu_adv_function.setlabel "Advanced  "
	}
	if advFunctionResults.isneq("") {
		call main.bu_adv_function.setlabel "Advanced *"
	}
END
PROGRAM advFunctionSubmit
BEGIN
	call program checkAdvFunctionResults
	call Submit
END

SCRIPT show_adv_function_line_dialog
BEGIN
	create CHILD gr_line_options AS advFunctionLine, allowsubmit
	advFunctionLine.setExitString advFunctionLineResults
	advFunctionLine.settitle "Function line properties"
	advFunctionLine.setExitAction "program checkAdvFunctionLineResults"
	advFunctionLine.setSubmitAction "program advFunctionLineSubmit "
END
PROGRAM checkAdvFunctionLineResults
BEGIN
	if advFunctionLineResults.iseq("") {
		call main.bu_adv_function_line.setlabel "Line properties  "
	}
	if advFunctionLineResults.isneq("") {
		call main.bu_adv_function_line.setlabel "Line properties *"
	}
END
PROGRAM advFunctionLineSubmit
BEGIN
	call program checkAdvFunctionLineResults
	call Submit
END

SCRIPT show_adv_pcline_dialog
BEGIN
	create CHILD gr_pcline_options AS advLine, allowsubmit
	advLine.setExitString advPcLineResults
	advLine.settitle "Paired-coordinate line properties"
	advLine.setExitAction "program checkAdvPcLineResults"
	advLine.setSubmitAction "program advPcLineSubmit"
END
PROGRAM checkAdvPcLineResults
BEGIN
	if advPcLineResults.iseq("") {
		call main.bu_adv_pcline.setlabel "Line properties  "
	}
	if ! advPcLineResults.iseq("") {
		call main.bu_adv_pcline.setlabel "Line properties *"
	}
END
PROGRAM advPcLineSubmit
BEGIN
	call program checkAdvPcLineResults
	call Submit
END

SCRIPT show_adv_pcmarker_dialog
BEGIN
	create CHILD gr_marker_options AS advMarkers, allowsubmit
	advMarkers.setExitString advPcMarkerResults
	advMarkers.settitle "Paired-coordinate marker properties"
	advMarkers.setExitAction "program checkAdvPcMarkerResults"
	advMarkers.setSubmitAction "program advPcMarkerSubmit"
	advMarkers.callthru "script gr_marker_setHeadlabelOn"
END
PROGRAM checkAdvPcMarkerResults
BEGIN
	if advPcMarkerResults.iseq("") {
		call main.bu_adv_pcmarker.setlabel "Marker properties  "
	}
	else {
		call main.bu_adv_pcmarker.setlabel "Marker properties *"
	}
END
PROGRAM advPcMarkerSubmit
BEGIN
	call program checkAdvPcMarkerResults
	call Submit
END

SCRIPT show_adv_pcarrow_dialog
BEGIN
	create CHILD gr_pcarrow_options AS advArrow, allowsubmit
	advArrow.setExitString advPcArrowResults
	advArrow.settitle "Paired-coordinate arrowhead properties"
	advArrow.setExitAction "program checkAdvPcArrowResults"
	advArrow.setSubmitAction "program advPcArrowSubmit"
END
PROGRAM checkAdvPcArrowResults
BEGIN
	if advPcArrowResults.iseq("") {
		call main.bu_adv_pcarrow.setlabel "Arrowhead properties  "
	}
	if ! advPcArrowResults.iseq("") {
		call main.bu_adv_pcarrow.setlabel "Arrowhead properties *"
	}
END
PROGRAM advPcArrowSubmit
BEGIN
	call program checkAdvPcArrowResults
	call Submit
END

INCLUDE ifin

PROGRAM gr_plot_output
BEGIN
	if main.rb_basic {
		put main.lb_type_basic " "
		varlist main.vn_basic_yvar
		varlist main.vn_basic_xvar
		put " " /program ifin_output
		if ! H(main.bu_basic_weight) {
			put " " basicMarkerWeights " "
		}
		beginoptions
			option main.ck_basic_sortx
			option main.ck_basic_y2
			if ! H(main.bu_basic_scatter) {
				put " " basicMarkerResults " "
			}
			if ! H(main.bu_basic_line) {
				put " " basicLineResults " "
			}
			if ! H(main.bu_basic_area) {
				put " " basicAreaResults " "
			}
			if ! H(main.bu_basic_bar) {
				put " " basicBarResults " "
			}
			if ! H(main.bu_basic_spike) {
				put " " basicSpikeResults " "
			}			
		endoptions
	}
	if main.rb_range {
		put main.lb_type_range " "
		varlist main.vn_range_yvar1
		varlist main.vn_range_yvar2
		varlist main.vn_range_xvar
		put " " /program ifin_output
		if ! H(main.bu_range_weight) {
			put " " rangeMarkerWeights " "
		}		
		beginoptions
			option main.ck_range_sortx
			option main.ck_range_y2
			if ! H(main.bu_range_area) {
				put " " rangeAreaResults " "
			}
			if ! H(main.bu_range_bar) {
				put " " rangeBarResults " "
			}
			if ! H(main.bu_range_spike) {
				put " " rangeSpikeResults " "
			}
			optionarg /hidedefault main.cb_range_cap_size
			if ! H(main.bu_range_scatter) {
				put " " rangeMarkerResults " "
			}
			if ! H(main.bu_range_line) {
				put " " rangeLineResults " "
			}
		endoptions
	}

	if main.rb_contour {
		put main.lb_type_contour " "
		varlist main.vn_con_zvar
		varlist main.vn_con_yvar
		varlist main.vn_con_xvar
		put " " /program ifin_output
		beginoptions
			option main.ck_con_y2
			if ! H(main.bu_contour) {
				put " " ContourResults " "
			}
			if ! H(main.bu_contourline) {
				put " " ContourLineResults " "
			}
		endoptions
	}
	
	if main.rb_fit {
		put main.lb_type_fit " "
		varlist main.vn_fit_yvar
		varlist main.vn_fit_xvar
		put " " /program ifin_output
		if ! H(main.bu_fit_weight) {
			put " " fitWeights " "
		}
		beginoptions
			option main.ck_fit_y2
			if ! H(main.bu_fit_lfit) {
				put " " fitLFitResults " "
			}
			if ! H(main.bu_fit_qfit) {
				put " " fitQFitResults " "
			}
			if ! H(main.bu_fit_fpfit) {
				put " " fitFPFitResults " "
			}
			if ! H(main.bu_fit_lfitci) {
				put " " fitLFitCiResults " "
			}
			if ! H(main.bu_fit_qfitci) {
				put " " fitQFitCiResults " "
			}
			if ! H(main.bu_fit_fpfitci) {
				put " " fitFPFitCiResults " "
			}
		endoptions
	}

	if main.rb_immediate {
		if main.lb_type_immediate.contains("scatteri") {
			if  ! (	imSci1 | imSci2 | imSci3 | imSci4 |	///
				imSci5 | imSci6 | imSci7 | imSci8 |	///
				imSci9 | imSci10 | imSci11 | imSci12 |	///
				imSci13 | imSci14 | imSci15 | imSci16 |	///
				imSci17 | imSci18 | imSci19 | imSci20 |	///
				imSci21 | imSci22 | imSci23 | imSci24 |	///
				imSci25 | imSci26 | imSci27 | imSci28 |	///
				imSci29 | imSci30 | imSci31 | imSci32 )	///
			{
			      call program immediate_error_1
			      exit 198
			}
			
			put main.lb_type_immediate " "
			put " " imSci1
			put " " imSci2
			put " " imSci3
			put " " imSci4
			put " " imSci5
			put " " imSci6
			put " " imSci7
			put " " imSci8
			put " " imSci9
			put " " imSci10
			put " " imSci11
			put " " imSci12
			put " " imSci13
			put " " imSci14
			put " " imSci15
			put " " imSci16
			put " " imSci17
			put " " imSci18
			put " " imSci19
			put " " imSci20
			put " " imSci21
			put " " imSci22
			put " " imSci23
			put " " imSci24
			put " " imSci25
			put " " imSci26
			put " " imSci27
			put " " imSci28
			put " " imSci29
			put " " imSci30
			put " " imSci31
			put " " imSci32
			beginoptions
				put " " immediateRecast " "
				put " " imLineResults " " 
				put " " imMarkerResults " "
				option main.ck_im_y2
			endoptions
		}
		if main.lb_type_immediate.contains("pci") 		///
			| main.lb_type_immediate.contains("pcarrowi") 	///
		{
			if  ! (	imPci1 | imPci2 | imPci3 | imPci4 |	///
				imPci5 | imPci6 | imPci7 | imPci8 |	///
				imPci9 | imPci10 | imPci11 | imPci12 |	///
				imPci13 | imPci14 | imPci15 | imPci16 |	///
				imPci17 | imPci18 | imPci19 | imPci20 |	///
				imPci21 | imPci22 | imPci23 | imPci24 |	///
				imPci25 | imPci26 | imPci27 | imPci28 |	///
				imPci29 | imPci30 | imPci31 | imPci32 )	///
			{
			      call program immediate_error_1
			      exit 198
			}
			put main.lb_type_immediate " "
			put " " imPci1
			put " " imPci2
			put " " imPci3
			put " " imPci4
			put " " imPci5
			put " " imPci6
			put " " imPci7
			put " " imPci8
			put " " imPci9
			put " " imPci10
			put " " imPci11
			put " " imPci12
			put " " imPci13
			put " " imPci14
			put " " imPci15
			put " " imPci16
			put " " imPci17
			put " " imPci18
			put " " imPci19
			put " " imPci20
			put " " imPci21
			put " " imPci22
			put " " imPci23
			put " " imPci24
			put " " imPci25
			put " " imPci26
			put " " imPci27
			put " " imPci28
			put " " imPci29
			put " " imPci30
			put " " imPci31
			put " " imPci32
			beginoptions
				put " " immediateRecast " "
				if ! H(main.bu_im_pcspike) {
					put " " imSpikeResults " " 
				}
				if ! H(main.bu_im_pcarrow) {
					put " " imArrowResults " "
				}
				if ! H(main.bu_im_pcmarker) {
					put " " imPcMarkerResults " "
				}
				option main.ck_im_y2
			endoptions		
		}
	}
	
	if main.rb_advanced {
		put main.lb_type_advanced " "
		if main.vn_adv_zvar.isvisible() {
			varlist main.vn_adv_zvar
		}
		if main.vn_adv_yvar.isvisible() {
			varlist main.vn_adv_yvar
		}
		if main.vn_adv_xvar.isvisible() {
			varlist main.vn_adv_xvar
		}
		if main.vn_adv_yvar2.isvisible() {
			varlist main.vn_adv_yvar2
		}
		if main.vn_adv_xvar2.isvisible() {
			varlist main.vn_adv_xvar2
		}
		if main.ex_adv_function.isvisible() {
			require main.ex_adv_function
			put main.ex_adv_function " " 
		}
		put " " /program ifin_output
		if ! H(main.bu_adv_weight) {
			put " " advWeights " "
		}
		beginoptions
			option main.ck_adv_y2
			if ! H(main.bu_adv_tsline) {
				put " " advTslineResults " "
			}
			if ! H(main.bu_adv_mband) {
				put " " advMbandResults " "
			}
			optionarg main.sp_adv_bands
			optionarg main.sp_adv_n
			if ! H(main.bu_adv_lowess) {
				put " " advLowessResults " "
			}
			if ! H(main.bu_adv_lowess_line) {
				put " " advLowessLineResults " "
			}
			if ! H(main.bu_adv_kdensity) {
				put " " advKdensityResults " "
			}
			if ! H(main.bu_adv_kdensity_line) {
				put " " advKdensityLineResults " "
			}
			option main.rb_adv_hist_discrete
			if ! H(main.bu_adv_histogram) {
				put " " advHistogramResults " "
			}
			if ! H(main.bu_adv_histogram_bar) {
				put " " advHistogramBarResults " "
			}
			if ! H(main.bu_adv_locpoly) {
				put " " advLocpolyResults " " 
			}
			if ! H(main.bu_adv_locpolyci) {
				put " " advLocpolyCiResults " " 
			}
			optionarg main.vn_adv_function_range
			if ! H(main.bu_adv_function) {
				put " " advFunctionResults " "
				put " " advFunctionLineResults " "
			}
			if ! H(main.bu_adv_pcline) {
				put " " advPcLineResults " "
			}
			if ! H(main.bu_adv_pcmarker) {
				put " " advPcMarkerResults " "
			}
			if ! H(main.bu_adv_pcarrow) {
				put " " advPcArrowResults " "
			}
		endoptions
	}
END

PROGRAM immediate_error_1
BEGIN
	stopbox stop "You must define at least one coordinate."
END

PROGRAM get_display_cmd
BEGIN
	if main.rb_basic {
		call PARENT.callthru `"build_CMD.setstring "(""'
		call main.lb_type_basic.withvalue PARENT.callthru `"build_CMD.append "@""'
		call PARENT.callthru `"build_CMD.append " ""'
		call main.vn_basic_yvar.withvalue PARENT.callthru `"build_CMD.append "@""'
		call PARENT.callthru `"build_CMD.append " ""'
		call main.vn_basic_xvar.withvalue PARENT.callthru `"build_CMD.append "@""'
	}
	if main.rb_range {
		call PARENT.callthru `"build_CMD.setstring "(""'
		call main.lb_type_range.withvalue PARENT.callthru `"build_CMD.append "@""'
		call PARENT.callthru `"build_CMD.append " ""'
		call main.vn_range_yvar1.withvalue PARENT.callthru `"build_CMD.append "@""'
		call PARENT.callthru `"build_CMD.append " ""'
		call main.vn_range_yvar2.withvalue PARENT.callthru `"build_CMD.append "@""'
		call PARENT.callthru `"build_CMD.append " ""'		
		call main.vn_range_xvar.withvalue PARENT.callthru `"build_CMD.append "@""'
	}
	if main.rb_contour {
		call PARENT.callthru `"build_CMD.setstring "(""'
		call main.lb_type_contour.withvalue PARENT.callthru `"build_CMD.append "@""'
		call PARENT.callthru `"build_CMD.append " ""'
		call main.vn_con_zvar.withvalue PARENT.callthru `"build_CMD.append "@""'
		call PARENT.callthru `"build_CMD.append " ""'
		call main.vn_con_yvar.withvalue PARENT.callthru `"build_CMD.append "@""'
		call PARENT.callthru `"build_CMD.append " ""'		
		call main.vn_con_xvar.withvalue PARENT.callthru `"build_CMD.append "@""'
	}
	if main.rb_fit {
		call PARENT.callthru `"build_CMD.setstring "(""'
		call main.lb_type_fit.withvalue PARENT.callthru `"build_CMD.append "@""'
		call PARENT.callthru `"build_CMD.append " ""'
		call main.vn_fit_yvar.withvalue PARENT.callthru `"build_CMD.append "@""'
		call PARENT.callthru `"build_CMD.append " ""'	
		call main.vn_fit_xvar.withvalue PARENT.callthru `"build_CMD.append "@""'
	}
	if main.rb_immediate {
		call PARENT.callthru `"build_CMD.setstring "(""'
		call main.lb_type_immediate.withvalue PARENT.callthru `"build_CMD.append "@""'
		if main.lb_type_immediate.contains("scatteri") {
			if imSci1 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci1.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci2 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci2.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci3 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci3.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci4 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci4.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci5 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci5.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci6 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci6.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci7 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci7.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci8 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci8.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci9 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci9.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci10 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci10.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci11 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci11.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci12 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci12.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci13 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci13.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci14 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci14.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci15 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci15.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci16 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci16.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci17 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci17.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci18 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci18.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci19 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci19.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci20 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci20.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci21 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci21.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci22 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci22.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci23 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci23.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci24 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci24.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci25 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci25.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci26 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci26.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci27 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci27.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci28 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci28.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci29 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci29.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci30 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci30.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci31 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci31.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imSci32 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imSci32.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
		}
		if main.lb_type_immediate.contains("pci") 		///
			| main.lb_type_immediate.contains("pcarrowi") 	///
		{
			if imPci1 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci1.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci2 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci2.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci3 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci3.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci4 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci4.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci5 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci5.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci6 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci6.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci7 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci7.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci8 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci8.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci9 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci9.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci10 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci10.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci11 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci11.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci12 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci12.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci13 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci13.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci14 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci14.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci15 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci15.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci16 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci16.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci17 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci17.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci18 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci18.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci19 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci19.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci20 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci20.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci21 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci21.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci22 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci22.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci23 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci23.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci24 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci24.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci25 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci25.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci26 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci26.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci27 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci27.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci28 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci28.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci29 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci29.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci30 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci30.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci31 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci31.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
			if imPci32 {
				call PARENT.callthru `"build_CMD.append " ""'
				call imPci32.withvalue PARENT.callthru `"build_CMD.append `"@"'"'
			}
		}
	}
	if main.rb_advanced {
		call PARENT.callthru `"build_CMD.setstring "(""'
		call main.lb_type_advanced.withvalue PARENT.callthru `"build_CMD.append "@""'
		if main.vn_adv_yvar.isvisible() {
			call PARENT.callthru `"build_CMD.append " ""'
			call main.vn_adv_yvar.withvalue PARENT.callthru `"build_CMD.append "@""'
		}
		if main.vn_adv_xvar.isvisible() {
			call PARENT.callthru `"build_CMD.append " ""'	
			call main.vn_adv_xvar.withvalue PARENT.callthru `"build_CMD.append "@""'
		}
		if main.vn_adv_yvar2.isvisible() {
			call PARENT.callthru `"build_CMD.append " ""'	
			call main.vn_adv_yvar2.withvalue PARENT.callthru `"build_CMD.append "@""'
		}
		if main.vn_adv_xvar2.isvisible() {
			call PARENT.callthru `"build_CMD.append " ""'	
			call main.vn_adv_xvar2.withvalue PARENT.callthru `"build_CMD.append "@""'
		}
		if main.ex_adv_function.isvisible() {
			call PARENT.callthru `"build_CMD.append " ""'	
			call main.ex_adv_function.withvalue PARENT.callthru `"build_CMD.append "@""'
		}
	}
	
	if sub.ex_if {
		call script get_cmd_if_args
	}
	if sub.ck_in {
		call script get_cmd_in_args
	}

	if main.rb_basic {
		if ! H(main.bu_basic_weight) {
			call PARENT.callthru `"build_CMD.append " ""'	
			call basicMarkerWeights.withvalue PARENT.callthru `"build_CMD.append "@""'
		}
	}
	if main.rb_range {
		if ! H(main.bu_range_weight) {
			call PARENT.callthru `"build_CMD.append " ""'	
			call rangeMarkerWeights.withvalue PARENT.callthru `"build_CMD.append "@""'
		}
	}
	if main.rb_fit {
		if ! H(main.bu_fit_weight) {
			call PARENT.callthru `"build_CMD.append " ""'	
			call fitWeights.withvalue PARENT.callthru `"build_CMD.append "@""'
		}
	}
	if main.rb_advanced {
		if ! H(main.bu_adv_weight) {
			call PARENT.callthru `"build_CMD.append " ""'	
			call advWeights.withvalue PARENT.callthru `"build_CMD.append "@""'
		}
	}
	
	if main.rb_basic {
		if main.ck_basic_sortx | main.ck_basic_y2 | 		 ///
		 ( ! H(main.bu_basic_scatter) & basicMarkerResults ) |   ///
		 ( ! H(main.bu_basic_line) & basicLineResults )      |   ///
		 ( ! H(main.bu_basic_area) & basicAreaResults )      |   ///
		 ( ! H(main.bu_basic_bar)  & basicBarResults )       |   ///
		 ( ! H(main.bu_basic_spike) & basicSpikeResults )        ///
		{
			call PARENT.callthru `"build_CMD.append ", ...""'
		}
		call PARENT.callthru `"build_CMD.append ")""'
	}

	if main.rb_range {
		if main.ck_range_sortx | main.ck_range_y2 |		 ///
		 ( ! H(main.bu_range_area) & rangeAreaResults )      |	 ///
		 ( ! H(main.bu_range_bar) & rangeBarResults )        |	 ///
		 ( ! H(main.bu_range_spike) & rangeSpikeResults )    |	 ///
		 ( ! H(main.cb_range_cap_size) & main.cb_range_cap_size ) | ///
		 ( ! H(main.bu_range_scatter) & rangeMarkerResults ) |	 ///
		 ( ! H(main.bu_range_line) & rangeLineResults ) 	 ///
		{
			call PARENT.callthru `"build_CMD.append ", ...""'
		}
		call PARENT.callthru `"build_CMD.append ")""'
	}

	if main.rb_contour {
		if main.ck_con_y2 |					///
		 ( ! H(main.bu_contour) & ContourResults )	|	///
	 	 ( ! H(main.bu_contourline) & ContourLineResults)	/// 
		{
			call PARENT.callthru `"build_CMD.append ", ...""'
		}
		call PARENT.callthru `"build_CMD.append ")""'
	}
	
	if main.rb_fit {
		if main.ck_fit_y2 |					 ///
		 ( ! H(main.bu_fit_lfit) & fitLFitResults )	|	 ///
		 ( ! H(main.bu_fit_qfit) & fitQFitResults )	|	 ///
		 ( ! H(main.bu_fit_fpfit) & fitFPFitResults )	|	 ///
		 ( ! H(main.bu_fit_lfitci) & fitLFitCiResults ) |	 ///
		 ( ! H(main.bu_fit_qfitci) & fitQFitCiResults ) |	 ///
		 ( ! H(main.bu_fit_fpfitci) & fitFPFitCiResults )	 ///
		{
			call PARENT.callthru `"build_CMD.append ", ...""'
		}
		call PARENT.callthru `"build_CMD.append ")""'
	}
	
	if main.rb_immediate {
		if immediateRecast.isneq("")	|			 ///
		 ( ! H(main.bu_im_marker) & imMarkerResults )	|	 ///
		 ( ! H(main.bu_im_line) & imLineResults )	|	 ///
		 ( ! H(main.bu_im_pcspike) & imSpikeResults )	|	 ///
		 ( ! H(main.bu_im_pcarrow) & imArrowResults )	|	 ///
		 ( ! H(main.bu_im_pcmarker) & imPcMarkerResults )	 ///
		{
			call PARENT.callthru `"build_CMD.append ", ""'
			
			if immediateRecast.isneq("") {
				call immediateRecast.withvalue PARENT.callthru `"build_CMD.append "@""'
			}
		 	if main.ck_im_y2 |				 ///
		 	 ( ! H(main.bu_im_marker) & imMarkerResults ) |  ///
		 	 ( ! H(main.bu_im_line) & imLineResults )     |  ///
		 	 ( ! H(main.bu_im_pcspike) & imSpikeResults ) |  ///
		 	 ( ! H(main.bu_im_pcarrow) & imArrowResults ) |	 ///
		 	 ( ! H(main.bu_im_pcmarker) & imPcMarkerResults) ///
			{
				call PARENT.callthru `"build_CMD.append " ...""'
			}
		}
		call PARENT.callthru `"build_CMD.append ")""'
	}
	
	if main.rb_advanced {
		if main.ck_adv_y2 |					///
		 ( ! H(main.bu_adv_tsline) & advTslineResults )  |	///
		 ( ! H(main.bu_adv_mband) & advMbandResults )	 |	///
		 ( ! H(main.ck_adv_bands) & main.ck_adv_bands )	 |	///
		 ( ! H(main.ck_adv_n) & main.ck_adv_n )		 |	///
		 ( ! H(main.bu_adv_lowess) & advLowessResults )  |	///
		 ( ! H(main.bu_adv_lowess_line) & advLowessLineResults ) | ///
		 ( ! H(main.bu_adv_kdensity) & advKdensityResults ) |	///
		 ( ! H(main.bu_adv_kdensity_line) 	///
		 	& advKdensityLineResults ) 		 |	///
		 ( ! H(main.bu_adv_histogram) & advHistogramResults) |	///
		 ( ! H(main.bu_adv_histogram_bar) 	///
		 	& advHistogramBarResults )		 | 	///
		 ( ! H(main.rb_adv_hist_discrete) 	///
		 	& main.rb_adv_hist_discrete )		 |	///
		 ( ! H(main.bu_adv_locpoly) & advLocpolyResults ) |	///
		 ( ! H(main.bu_adv_locpolyci) & advLocpolyCiResults ) |	///
		 ( ! H(main.bu_adv_pcline) & advPcLineResults )	 |	///
		 ( ! H(main.bu_adv_pcmarker) & advPcMarkerResults ) |	///
		 ( ! H(main.bu_adv_pcarrow) & advPcArrowResults )   |	///
		 ( ! H(main.vn_adv_function_range) 	///
		 	& main.vn_adv_function_range ) 		|	///
		 ( ! H(main.bu_adv_function)  	   	///
		 	& (advFunctionResults | advFunctionLineResults )) ///
		{
			call PARENT.callthru `"build_CMD.append ", ...""'
		}
		call PARENT.callthru `"build_CMD.append ")""'
	}
END

SCRIPT get_cmd_if_args
BEGIN
	PARENT.callthru `"build_CMD.append "  if ""'
	sub.ex_if.withvalue PARENT.callthru `"build_CMD.append "@""'
END
SCRIPT get_cmd_in_args
BEGIN
	PARENT.callthru `"build_CMD.append "  in ""'
	sub.sp_from.withvalue PARENT.callthru `"build_CMD.append "@""'
	PARENT.callthru `"build_CMD.append "/""'
	sub.sp_to.withvalue PARENT.callthru `"build_CMD.append "@""'
END

PROGRAM command
BEGIN
	put "("
	put /program gr_plot_output
	put ") "
	
	// update flags in the parent for y axis(2) options
	if main.rb_basic {
		if ! H(main.ck_basic_y2) & main.ck_basic_y2 {
			call PARENT.callthru "build_isY2Set.settrue"
		}
		if H(main.ck_basic_y2) | ! main.ck_basic_y2 {
			call PARENT.callthru "build_isY2Set.setfalse"
		}
	}
	if main.rb_range {
		if ! H(main.ck_range_y2) & main.ck_range_y2 {
			call PARENT.callthru "build_isY2Set.settrue"
		}
		if H(main.ck_range_y2) | ! main.ck_range_y2 {
			call PARENT.callthru "build_isY2Set.setfalse"
		}
	}
	if main.rb_contour {
		if ! H(main.ck_con_y2) & main.ck_con_y2 {
			call PARENT.callthru "build_isY2Set.settrue"
		}
		if H(main.ck_con_y2) | ! main.ck_con_y2 {
			call PARENT.callthru "build_isY2Set.setfalse"
		}
	}
	if main.rb_fit {
		if ! H(main.ck_fit_y2) & main.ck_fit_y2 {
			call PARENT.callthru "build_isY2Set.settrue"
		}
		if H(main.ck_fit_y2) | ! main.ck_fit_y2 {
			call PARENT.callthru "build_isY2Set.setfalse"
		}
	}
	if main.rb_immediate {
		if ! H(main.ck_im_y2) & main.ck_im_y2 {
			call PARENT.callthru "build_isY2Set.settrue"
		}
		if H(main.ck_im_y2) | ! main.ck_im_y2 {
			call PARENT.callthru "build_isY2Set.setfalse"
		}
	}
	if main.rb_advanced {
		if ! H(main.ck_adv_y2) & main.ck_adv_y2 {
			call PARENT.callthru "build_isY2Set.settrue"
		}
		if H(main.ck_adv_y2) | ! main.ck_adv_y2 {
			call PARENT.callthru "build_isY2Set.setfalse"
		}
	}
	call program get_display_cmd
END
