	PRO Split_w_h, w_h, HXT=hxt, WBS=wbs
;	-----------------------------------------------------------
;+						19-Aug-91
;	NAME:
;		Split_w_h
;	PURPOSE:
;		Split w_h logical record into two logical records:
;		hxt and wbs.
;	CALLING SEQUENCE:
;		Split_w_h, w_h, [HXT=hxt, WBS=wbs]
;	INPUT:
;		w_h	logical record vector for hxt and wbs.
;	OUTPUT/Keyword:
;		hxt	logical record vector for hxt
;		wbs	logical record vector for wbs
;	HISTORY:
;		written 19-Aug-91, by GAL
;-
;	-----------------------------------------------------------
;	ON_ERROR, 2	;force a return to caller on error

	hxtIdx = WHERE((w_h.whichInstru AND 240b) ne 0,nhxt)
	wbsIdx = WHERE((w_h.whichInstru AND 15b) ne 0,nwbs)

	IF (hxtIdx(0) ne -1) THEN BEGIN	;some matches found
	  hxt = REPLICATE({Obs_HXT_Rec}, nhxt)
	  FOR i= 0, N_TAGS(hxt)-2 DO BEGIN	;the quick-way, screwed
						;if Mons changes things.
	    hxt.(i) = w_h(hxtIdx).(i+1)		;load the new structures
	  ENDFOR                 		;Note: hxt has 1 spare byte
	ENDIF 

	IF (wbsIdx(0) ne -1) THEN BEGIN	;some matches found
	  wbs = REPLICATE({Obs_WBS_Rec}, nwbs)
	  FOR i=0, 5 DO BEGIN			;load the 1st 6 tags
	    wbs.(i) = w_h(wbsIdx).(i+1)	
	  ENDFOR
	  FOR i=6, N_TAGS(wbs)-2 DO BEGIN	;wbs also has 1 spare byte
	    wbs.(i) = w_h(wbsIdx).(i+8)		;if w_h changes this will
	  					;not work.
	  ENDFOR
	ENDIF

	RETURN
	END
