!********************************************************************
!*                                                                  *
!*  Program:  DCLMENU1                                              *
!*                                                                  *
!*  Purpose:  Interface between DCL and menu subroutine.  Gets &    *
!*            puts DCL symbols.                                     *
!*                                                                  *
!*  Programmer:  Richard Snyder                                     *
!*               The KeTech Corporation                             *
!*                                                                  *
!********************************************************************
	character*60 	prompt_string(16)
	character*80 	start_string
	character 	symbol_name*10
	character	code*2
	character	name*8
	character	code1*1
	integer*4 	no_choices
	data 		symbol_name	/'MENU_VALUE'/
	data 		name		/'STRING'/
!
!	check if we need to clear the screen
!
	istat = lib$get_foreign(start_string)
	ifind = lib$index(start_string,'/NOREPAINT')
	if (ifind .eq. 0) then
		ipaint_code = 1
	else
		ipaint_code = 0
	endif
!
!	get the menu description from dcl symbols
!
	iret = lib$get_symbol('NUMBER_CHOICES',code)
	if (.not. iret) then
		icode = 0
		go to 100
	endif	
	read(code,'(i2)',err=33)no_choices
	go to 34
33	icode = 0
	go to 100
!
!	loop to get the menu item description strings
!
34	if (no_choices .gt. 15) then
		no_choices = no_choices/10
	endif
	do i=1, no_choices+1
		write(name(7:8),'(i2.2)')i
		iret = lib$get_symbol(name,prompt_string(i))
		if (.not. iret) then
			icode = 0
			go to 100
		endif
	enddo
!
!	put up the menu and wait for their choice
!
	call menu1 (prompt_string,no_choices,icode,ipaint_code)
!
!
!
100	if (icode .ge. 10) then
		write (code,'(i2)')icode
		iret = lib$set_symbol(symbol_name,code)
	else
		write (code1,'(i1)')icode
		iret = lib$set_symbol(symbol_name,code1)
	endif
!
	call sys$exit (%val(1))
!
	end
