*-----------------------------------------------------------------------
      SUBROUTINE SWCQNP(NCP)

      CHARACTER CP*(*), CVAL*(*)

      PARAMETER (NPARA = 12)

      LOGICAL   LCHREQ, LFIRST
      CHARACTER CPARAS(NPARA)*8
      CHARACTER CPARAL(NPARA)*40
      CHARACTER CX(NPARA)*80, CMSG*80

      EXTERNAL  LCHREQ, LENC

      SAVE

      DATA      CPARAS( 1)/'WSNAME01'/, CX( 1)/'CRT       '/
      DATA      CPARAS( 2)/'WSNAME02'/, CX( 2)/'LIPS      '/
      DATA      CPARAS( 3)/'WSNAME03'/, CX( 3)/'PS     '/
      DATA      CPARAS( 4)/'FNAME   '/, CX( 4)/'dcl     '/
      DATA      CPARAS( 5)/'TITLE   '/, CX( 5)/'*       '/
      DATA      CPARAS( 6)/'CLRMAP  '/, CX( 6)/'colormap'/
      DATA      CPARAS( 7)/'BITM08  '/, CX( 7)/'bitmap08'/
      DATA      CPARAS( 8)/'BITM32  '/, CX( 8)/'bitmap32'/
      DATA      CPARAS( 9)/'CL2TN   '/, CX( 9)/'cl2tnmap'/
      DATA      CPARAS(10)/'FONT1   '/, CX(10)/'font1u  '/
      DATA      CPARAS(11)/'FONT2   '/, CX(11)/'font2u  '/
      DATA      CPARAS(12)/'LPR     '/, CX(12)/'PRN     '/

      DATA      CPARAL( 1)/'DEVICE_NAME01'/
      DATA      CPARAL( 2)/'DEVICE_NAME02'/
      DATA      CPARAL( 3)/'DEVICE_NAME03'/
      DATA      CPARAL( 4)/'FLAME_NAME'/
      DATA      CPARAL( 5)/'TITLE'/
      DATA      CPARAL( 6)/'COLORMAP'/
      DATA      CPARAL( 7)/'BITMAP08'/
      DATA      CPARAL( 8)/'BITMAP32'/
      DATA      CPARAL( 9)/'COLOR_TO_TONE_MAP'/
      DATA      CPARAL(10)/'FONT1'/
      DATA      CPARAL(11)/'FONT2'/
      DATA      CPARAL(12)/'LPR'/

      DATA      LFIRST / .TRUE. /

      NCP = NPARA

      RETURN
*-----------------------------------------------------------------------
      ENTRY SWCQID(CP, IDX)

      DO 10 N = 1, NPARA
        IF (LCHREQ(CP, CPARAS(N)) .OR.
     &        LCHREQ(CP, CPARAL(N))) THEN
          IDX = N
          RETURN
        END IF
   10 CONTINUE
      CMSG = 'PARAMETER '''//CP(1:LENC(CP))//''' IS NOT DEFINED.'
      CALL MSGDMP('E', 'SWCQID', CMSG)

      RETURN
*-----------------------------------------------------------------------
      ENTRY SWCQCP(IDX, CP)

      IF (1.LE.IDX .AND. IDX.LE.NPARA) THEN
        CP = CPARAS(IDX)
      ELSE
        CALL MSGDMP('E', 'SWCQCP', 'IDX IS OUT OF RANGE.')
      END IF

      RETURN
*-----------------------------------------------------------------------
      ENTRY SWCQCL(IDX, CP)

      IF (1.LE.IDX .AND. IDX.LE.NPARA) THEN
        CP = CPARAL(IDX)
      ELSE
        CALL MSGDMP('E', 'SWCQCL', 'IDX IS OUT OF RANGE.')
      END IF

      RETURN
*-----------------------------------------------------------------------
      ENTRY SWCQVL(IDX, CVAL)

      IF (LFIRST) THEN
        CALL RTCGET('SW:', CPARAS, CX, NPARA)
        CALL RLCGET(CPARAL, CX, NPARA)
        LFIRST = .FALSE.
      END IF

      IF (1.LE.IDX .AND. IDX.LE.NPARA) THEN
        CVAL = CX(IDX)
      ELSE
        CALL MSGDMP('E', 'SWCQVL', 'IDX IS OUT OF RANGE.')
      END IF

      RETURN
*-----------------------------------------------------------------------
      ENTRY SWCSVL(IDX, CVAL)

      IF (LFIRST) THEN
        CALL RTCGET('SW:', CPARAS, CX, NPARA)
        CALL RLCGET(CPARAL, CX, NPARA)
        LFIRST = .FALSE.
      END IF

      IF (1.LE.IDX .AND. IDX.LE.NPARA) THEN
        CX(IDX) = CVAL
      ELSE
        CALL MSGDMP('E', 'SWCSVL', 'IDX IS OUT OF RANGE.')
      END IF

      RETURN
*-----------------------------------------------------------------------
      ENTRY SWCQIN(CP, IN)

      DO 20 N = 1, NPARA
         IF (LCHREQ(CP, CPARAS(N)) .OR.
     &        LCHREQ(CP, CPARAL(N))) THEN
            IN = N
            RETURN
         ENDIF
 20   CONTINUE

      IN = 0

      RETURN
      END
