Debian Codegraph @

packages/seacas/applications/blot/setfor.f

raw
1 C Copyright(C) 1999-2020 National Technology & Engineering Solutions
2 C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 C NTESS, the U.S. Government retains certain rights in this software.
4 C
5 C See packages/seacas/LICENSE for details
6
7 C============================================================================
8 SUBROUTINE SETFOR (IFUNC, INLINE, IFLD, INTYP, CFIELD, *)
9 C============================================================================
10
11 C --*** SETFOR *** (BLOT) Process FOREGROUND command
12 C -- Written by John Glick - 2/27/89
13 C --
14 C --Parameters:
15 C -- IFUNC - IN - = 1 if the call is to parse the FOREGROUND
16 C -- command.
17 C -- = 2 if the call is to reset the foreground color
18 C -- to the default color.
19 C -- INLINE - IN/OUT - the parsed input lines for the log file
20 C -- IFLD, INTYP, CFIELD, - IN/OUT - the free-field reader
21 C -- index and character field.
22 C -- * - return statement if command error; message is printed.
23
24 include 'params.blk'
25 INTEGER IFUNC
26 CHARACTER*(*) INLINE(*)
27 INTEGER IFLD, INTYP(*)
28 CHARACTER*(*) CFIELD(*)
29
30 include 'plcolr.blk'
31 include 'plcol2.blk'
32
33 LOGICAL FFEXST
34 INTEGER IDCOL, LOCSTR
35
36 CHARACTER*(mxstln) COLA, COLF
37 include 'cmap-lst.blk'
38 INTEGER DEFFOR
39 SAVE DEFFOR
40
41 DATA DEFFOR / 2 /
42
43 c DATA FORGND /'WHITE '/
44
45 C *****************************************************************
46
47 IF (IFUNC .EQ. 1) THEN
48
49 IF (FFEXST (IFLD, INTYP)) THEN
50
51 C Check that next field has characters in it.
52
53 IF (INTYP(IFLD) .GE. 0) THEN
54 COLA = CFIELD(IFLD)
55 IFLD = IFLD + 1
56 CALL ABRSTR (COLF, COLA, COLLST)
57 IF (COLF .EQ. ' ') THEN
58 WRITE (*, 10000) COLA
59 10000 FORMAT (1X, A, ' not a valid color name.')
60 GO TO 100
61 ELSE
62 IDCOL = LOCSTR (COLF, NCOLOR, COLLST)
63 CALL FFADDC (COLF, INLINE)
64 IF (IDCOL .GT. 0) THEN
65 FORGND = COLF
66 IDFOR = IDCOL
67 IDFORT = IDCOL
68 ELSE
69 WRITE (*, 10000) COLA
70 GO TO 100
71 ENDIF
72 ENDIF
73 ELSE
74 CALL PRTERR ('CMDERR',
75 & 'Expected color name following FOREGROUND command')
76 GOTO 100
77 ENDIF
78 ELSE
79
80 CALL PRTERR ('CMDERR',
81 & 'Expected color name following FOREGROUND command')
82 GOTO 100
83
84 ENDIF
85
86 ELSE IF (IFUNC .EQ. 2) THEN
87
88 IDFOR = DEFFOR
89 IDFORT = DEFFOR
90 FORGND = 'WHITE '
91
92 ENDIF
93
94 RETURN
95
96 100 CONTINUE
97 RETURN 1
98
99 END