1
2C*GRQDT -- inquire current device and type
3C+
4      SUBROUTINE GRQDT (DEVICE)
5C
6C GRPCKG: obtain the name and type of the current graphics device.
7C
8C Argument:
9C
10C DEVICE (output, character): receives the device name and type of the
11C       currently active device in the form 'device/type'; this is a
12C       valid string for input to GROPEN.
13C--
14C  1-Feb-1983
15C 19-Feb-1988 - add quotes if necessary.
16C-----------------------------------------------------------------------
17      INCLUDE 'grpckg1.inc'
18      CHARACTER*(*) DEVICE
19      CHARACTER*14 TYPE
20      LOGICAL   JUNK
21      INTEGER   L
22C
23      IF (GRCIDE.LT.1) THEN
24          CALL GRWARN('GRQDT - no graphics device is active.')
25          DEVICE = '/NULL'
26      ELSE
27          CALL GRQTYP(TYPE,JUNK)
28          L = GRFNLN(GRCIDE)
29          IF (L.LE.0) THEN
30              DEVICE = '/'//TYPE
31          ELSE IF (INDEX(GRFILE(GRCIDE)(1:L), '/').EQ.0) THEN
32              DEVICE = GRFILE(GRCIDE)(1:L)//'/'//TYPE
33          ELSE
34              DEVICE = '"'//GRFILE(GRCIDE)(1:L)//'"/'//TYPE
35          END IF
36      END IF
37      END
38