Debian Codegraph @

packages/seacas/applications/blot/grikey.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 GRIKEY (PROMPT, DX, DY, KEY, *)
9 C=======================================================================
10
11 C --*** GRIKEY *** (GRPLIB) Position cursor and wait for a key (PLT)
12 C -- Written by Amy Gilkey - revised 04/28/88
13 C --
14 C --GRIKEY positions a cursor and waits until a key is pressed.
15 C --A message may be output before the cursor is positioned. The
16 C --cursor position and the key are returned.
17 C --
18 C --The first time this routine is called, a warning message is output.
19 C --
20 C --Parameters:
21 C -- PROMPT - IN - prompt for key if non-blank
22 C -- DX, DY - IN/OUT - the device coordinates of cursor
23 C -- KEY - OUT - returned key pressed; upper-case
24 C -- * - the alternate return if cancel requested or cursor input error
25
26 C --Routines Called:
27 C -- PLTCRS - (PLTLIB) Select cursor position
28 C -- PLTFLU - (PLTLIB) Flush buffer
29 C -- LENSTR - (STRLIB) Find string length
30
31 CHARACTER*(*) PROMPT
32 REAL DX, DY
33 CHARACTER KEY
34
35 LOGICAL FIRST
36 SAVE FIRST
37
38 DATA FIRST / .TRUE. /
39
40 CALL PLTFLU
41
42 IF (FIRST) THEN
43 WRITE (*, 10000)
44 FIRST = .FALSE.
45 END IF
46
47 IF (PROMPT .NE. ' ') THEN
48 WRITE (*, '(1X, A)') PROMPT(:LENSTR(PROMPT))
49 END IF
50
51 CALL PLTCRS (DX, DY, KEY)
52
53 IF ((DX .LT. 0.0) .OR. (DX .GT. 1.0)
54 & .OR. (DY .LT. 0.0) .OR. (DY .GT. 1.0)) THEN
55 WRITE (*, 10010)
56 RETURN 1
57 END IF
58
59 CALL EXUPCS (KEY)
60
61 RETURN
62 10000 FORMAT (/,
63 & 15X,'*** Press SPACE or a letter to pick a point ***', /)
64 10010 FORMAT (/,
65 & ' *** ERROR on cursor input ***', /)
66 END