C---------------------------------------------------------------------------
	CHARACTER*80 FUNCTION NEWEXT(file,ext)
C---------------------------------------------------------------------------
C  Returns a new file name where the extension has been changed and
C  the version number has been dropped.
C  NOTE: ext is not required to start with a period
C---------------------------------------------------------------------------
	CHARACTER*(*) file,ext

	character*40 node,device,dir,name*60,type*20,ver*5
	integer*2 len_node,len_device,len_dir,len_name,len_type,len_ver

	call fparse(file,node,len_node,device,len_device,
	1	dir,len_dir,name,len_name,type,len_type,ver,len_ver)
	if (ext(1:1) .ne. '.') then 
	  type = '.'//ext
	else
	  type = ext
	endif
	NEWEXT = node(:len_node)//device(:len_device)//dir(:len_dir)
	1	//name(:len_name)//type
	RETURN
	END
