	integer function blength(line)
c  return length to final non-blank, non-NUL
c  this should not be used if final blanks are significant
	character*(*) line
	declen = len(line)	! declared length
	do i=declen,1,-1
		blength = i
		if(line(i:i).ne.' '.and.line(i:i).ne.char(0)) goto 300
	enddo
c  all blank or NUL
	blength=0

300	continue
c	print *,'blength=',blength
	return
	end

