pro get_qs, entry_type, str_name, n_bytes
;
;
;
gen_struct
bcs_struct
bcs_old_struct
sxt_struct
hxt_struct
wbs_struct
;
str_name = ''
case entry_type of
    '1011'x: str_name = "{qs_general1_rec}"

    '2011'x: str_name = "{bcs_qs_instr_rec}"
    '2021'x: str_name = "{bcs_qs_modeinit_rec}"
    '2031'x: str_name = "{bcs_qs_conv_rec}"
    '2041'x: str_name = "{bcs_qs_group_rec}"

    '3011'x: str_name = "{sxt_3011_qs_instr_rec}"
    '3021'x: str_name = "{sxt_3021_qs_conv_rec}"

    '4011'x: str_name = "{hxt_qs_instr_rec}"
    '4021'x: str_name = "{hxt_qs_conv_rec}"
    '4031'x: str_name = "{hxi_qs_scpara_rec}"
    '4041'x: str_name = "{hxi_qs_bkg_rec}"

    '5011'x: str_name = "{wbs_qs_instr_rec}"
    '5021'x: str_name = "{wbs_qs_offset_rec}"
    '5031'x: str_name = "{wbs_qs_del_rec}"
    '5041'x: str_name = "{wbs_qs_conv1_rec}"
    '5051'x: str_name = "{wbs_qs_conv2_rec}"


    ;----- Old entry type code values (Prior to 15-Oct-91)
    '0111'x: str_name = "{qs_general1_rec}"

    '0211'x: str_name = "{bcs_qs_0211_instr_rec}"		;old structure version
    '0212'x: str_name = "{bcs_qs_instr_rec}"
    '0221'x: str_name = "{bcs_qs_conv_rec}"
    '0231'x: str_name = "{bcs_qs_group_rec}"

    else: begin
	print, 'GET_QS: Do not recognize the entry_type  ', string(entry_type, format='(z4.4)')
	stop
    end
endcase
;
str = "n_bytes = get_nbytes(" + str_name + ")"
exe_stat = execute(str)
;
end
