	FUNCTION Strs2mat, structure=a, stVAL=stTag, enVAL=enTag, $
				blank=val
;	-------------------------------------------------------------
;+							26-June-91
;	Name:
;		Strs2Mat
;	Purpose:
;		Convert a group of strings within a structure to
;		a matrix of the same data-type specified by the 
;		Keyword "blank".
;	CALLING SEQUENCE:
;		matrix = Strs2mat([structure=a, stVal=stTag, 
;			 enVal=enTag, blank=val])
;	Input/Keywords:
;		a	input structure to be converted
;		stTag	starting Tag number for the conversion
;		enTag	ending Tag number for the conversion
;		val	default value for blanks and data type of 
;			return matrix.
;	Returned:
;		matrix of type equal to the data-type for the Keyword
;		specifier "blank".
;	History:
;		written 26-June-91 by GAL
;-
;	-------------------------------------------------------------
;	ON_ERROR, 2 	;force a return to caller on error

	IF (NOT KEYWORD_SET(val)) THEN BEGIN	;undefined default val
	  val = LONG(-1)		;assign default val for fill
	ENDIF

	def_info = SIZE(val)	;check for data-type
	data_type = def_info(def_info(0)+1)	;data-type code

;	Find the Maximum number of columns for the matrix:
	col = 0			;initialize number of columns
	FOR i= stTag, enTag DO BEGIN
	  s = STR2ARR(a.(i))	;convert string to array
	  j = N_ELEMENTS(s)
	  IF (j GT col) THEN col = j
	ENDFOR

	sval = STRING(val)	;load default value as a string	
	row  = enTag - stTag +1
	smat = STRARR(col,row)	;initialize to maximum size  
	smat(*,*) = sval
	irow = 0		;matrix row counter
	FOR i= stTag, enTag DO BEGIN
	  s = STR2ARR(a.(i))
	  iblank = WHERE(s eq ' ')	;find blanks
	  IF (iblank(0) ne -1) THEN BEGIN
	    s(iblank) = sval		;fill blanks with sval   
	  ENDIF
	  smat(0,irow) = s		;load string matrix
	  irow = irow + 1
	ENDFOR

	CASE (data_type) OF
	  1:	mat = BYTE(smat)
	  2:	mat = FIX(smat)
	  3:	mat = LONG(smat)
	  ELSE:	BEGIN
		  Print, 'Invalid data-type specified in BLANK Keyword'
		  RETURN, -1
	        END
	ENDCASE

	RETURN, mat	
	END 	
