      SUBROUTINE TONFLG ( IPTFLG )
C
C
C    LANGUAGE:  FORTRAN
C
C    OPERATING SYSTEM:  UNIVERSAL
C
C    ORDER NUMBER:  5428-SE
C
C    PART NUMBER:  000-026366  NOVEMBER 1985
C
C    PRODUCT:  UNIVERSAL VERSAPLOT COLOR RANDOM 2.0
C
C    VERSATEC, INC., SANTA CLARA, CALIFORNIA 95051
C    A XEROX COMPANY
C
C    Copyright (C) 1985 by Xerox Corporation.  All rights reserved.
C
C    "NOTICE. THIS PROGRAM IS THE EXCLUSIVE PROPERTY OF VERSATEC,
C    INC. AND IS ISSUED IN STRICT CONFIDENCE UNDER A PREARRANGED
C    LICENSE AGREEMENT AND IS NOT TO BE DISCLOSED IN ANY MANNER TO
C    PERSONS OUTSIDE THE LICENSED ORGANIZATION AND SHALL NOT BE
C    REPRODUCED OR DISSEMINATED, IN WHOLE OR PART, TO ANYONE OUTSIDE
C    THE LICENSED ORGANIZATION WITHOUT THE PRIOR WRITTEN APPROVAL OF
C    VERSATEC, INC. UNLESS OTHERWISE PROVIDED FOR BY SUCH LICENSE
C    AGREEMENT.  THIS WORK IS PROTECTED AS AN UNPUBLISHED WORK UNDER
C    THE COPYRIGHT ACT OF 1976."
C
C     NAME:  TONFLG
C
C     THIS ROUTINE CAN BE USED TO SELECT THE TYPE OF
C     TONING FOR POLYGON AND CIRCLE INTERIORS.  IF HATCH
C     PATTERN TONING IS SELECTED, THE INTERIOR WILL BE
C     TONED WITH THE PATTERN SET ACTIVE BY THE LATEST
C     CALL TO SETPAT OR TONE.  WHEN COLOR TONING IS
C     SELECTED, THE INTERIOR WILL BE TONED IN THE COLOR
C     SET ACTIVE BY THE LATEST CALL TO TONCLR.
C
C     ENTRY:  CALL TONFLG ( IPTFLG )
C
C               IPTFLG - FLAG TO SELECT PEN OR TONE COLOR
C                        FOR POLYGON TONING.
C
C                        0 = PEN COLOR (HATCH; DEFAULT).
C                        1 = TONE COLOR.
C
C     EXIT:  RETURN.
C
C     CALLS:  NONE.
C
C     CALLED BY:  USER
C
C     COMMON USED:
C       /CLRCOM/
C            I ITNFLG  - USE PEN OR TONE COLOR FOR AREAS
C            I IVCFLG  - FLAG TO INDICATE COLOR MODE SET
C
C
C...  COMMON /CLRCOM/ - COLOR VARIABLES
C
      INTEGER PCOLOR, CURPEN
      LOGICAL PENCHG
      COMMON /CLRCOM/
     *    ICLMAX,  ITNCLR,  ITNFLG,  IVCFLG,  NCPASS,  PENCHG,
     *         CURPEN(4), ICLRDF(4,512), IDASRT(4), ITNSEQ(4),
     *         PCOLOR(64)
C
C
C...  REPORT AN ERROR IF COLOR MODE NOT SET.
      IF ( IVCFLG .NE. 0 )  GOTO 0100
        CALL MSGLG1(102)
        GOTO 9999
C
C...  SAVE THE FLAG FOR OTHER ROUTINES.
 0100 CONTINUE
      ITNFLG = 0
      IF (IPTFLG .NE. 0) ITNFLG = -1
C
C...  ALL DONE, EXIT.
 9999 CONTINUE
      RETURN
      END
