1d.ask(1) Grass User's Manual d.ask(1)
2
3
4
6 d.ask - Prompts the user to select a GRASS data base file from among
7 files displayed in a menu on the graphics monitor.
8
10 display
11
13 d.ask
14 d.ask help
15 d.ask element=name,description [prompt="message"] [--verbose]
16 [--quiet]
17
18 Parameters:
19 element=name,description
20 Database element , one word description
21
22 prompt=
23 Short user prompt message
24
26 d.ask is designed for shell scripts that need to prompt the user for
27 the name of a data base file in the user's current GRASS mapset search
28 path. After d.ask is invoked with needed parameters, the mouse becomes
29 active and a menu containing files of the specified element type is
30 displayed on the user's graphics monitor. The user is prompted by the
31 prompt "message" to select one of the listed file names with the mouse.
32 Specifically, the query that appears to the user takes the form:
33
34 Double click on the prompt "message"
35 Double click here to cancel
36
37 (A list of files of the specified element type from each of the
38 mapsets listed in the user's mapset search path is also displayed.)
39
40 After the user responds, the mouse is deactivated and the displayed
41 menu is erased from the screen (leaving any underlying materials on
42 display intact). Three lines are written to standard output (the
43 user's terminal screen):
44
45 name=file_name
46 mapset=mapset_name
47 fullname=file_name@mapset_name
48
49 Parameters:
50 element=name,description
51 Name of a GRASS data base element, followed by a one word
52 description of the element. GRASS data base elements are mapset
53 subdirectories; these include: bdlg, cats, cell, cell_misc,
54 cellhd, colr, colr2, dig, dig_ascii, dig_att, dig_cats,
55 dig_plus, dlg, group, hist, icons, noise, paint, site_lists, and
56 windows. The description will be used to display an error mes‐
57 sage to the screen if no files of the named element type exist
58 in the user's mapset search path. The prompt "message" will
59 appear in the pop-up menu displayed on the user's graphics moni‐
60 tor. The files listed in the menu will be of the specified ele‐
61 ment type, and exist in mapsets listed in the user's current
62 mapset search path.
63
64 prompt=
65 A brief message with which the user will be prompted. If this
66 message contains more than one word, it should be enclosed
67 within double quotes (""). It is a non-selectable message dis‐
68 played in the menu bar of a pop-up menu. Selectable items in
69 the displayed menu include a cancel option and any of the files
70 in the mapset subdirectory name in the user's mapset search
71 path.
72
74 Given the following input,
75
76 d.ask element=cell,raster prompt="raster map layer to be used"
77
78 d.ask will prompt the user to select a raster (cell) file from among
79 those listed in the "cell" directories of the mapsets listed in his
80 current mapset search path. A pop-up menu will be displayed on the
81 user's graphics monitor, containing the prompt:
82
83 Double click on the raster map layer to be used
84 Double click here to cancel
85
87 If the user selects a file name from the displayed menu, d.ask writes
88 three lines to standard output:
89
90 name=file_name
91 mapset=mapset_name
92 fullname=file_name@mapset_name
93
94 The output is in the form of /bin/sh commands to set the variable name
95 to the file name specified by the user (of the element type requested
96 by d.ask), mapset to the GRASS mapset in which this file resides, and
97 fullname to the name of the file and its mapset.
98
99 If the user elects not to select a file but instead chooses the "Double
100 click here to cancel" option, the mouse will be deactivated and no
101 variable assignments will be returned to standard output.
102
103 If no files of the specified element type are found in the user's cur‐
104 rent mapset search path, the mouse is activated and the following mes‐
105 sage is displayed on the user's graphics monitor:
106
107 No element description files found
108 Click here to continue
109
111 Parameter values (the element name and description, and prompt message)
112 cannot be supplied to d.ask interactively; they must be supplied on the
113 command line or from a file.
114
116 g.ask,
117 g.filename,
118 g.findfile,
119 g.gisenv,
120 g.mapsets
121
123 This program calls other GRASS programs which may generate confusing
124 error messages. Example: an error message from the program d.menu will
125 appear if a nonexistent map element is chosen.
126
128 Michael Shapiro, U.S. Army Construction Engineering Research Laboratory
129
130 Last changed: $Date: 2007-06-04 12:36:33 +0200 (Mon, 04 Jun 2007) $
131
132 Full index
133
134 © 2003-2008 GRASS Development Team
135
136
137
138GRASS 6.3.0 d.ask(1)