-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmaptile_geohelp.ado
50 lines (37 loc) · 1.58 KB
/
maptile_geohelp.ado
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
*! version 1.0.5 22june2017 Michael Stepner, [email protected]
/*** Unlicence (abridged):
This is free and unencumbered software released into the public domain.
It is provided "AS IS", without warranty of any kind.
For the full legal text of the Unlicense, see <http://unlicense.org>
*/
* Why did I include a formal license? Jeff Atwood gives good reasons:
* http://blog.codinghorror.com/pick-a-license-any-license/
program define maptile_geohelp
version 11
set more off
syntax name(name=geography id="geoname") [, geofolder(string)]
* Set default directory
if (`"`geofolder'"'=="") local geofolder `c(sysdir_personal)'maptile_geographies
* Check that the geography is installed
cap confirm file `"`geofolder'/`geography'_maptile.ado"'
if (_rc!=0) {
di as error "geography(`geography') specified, but it is not installed."
if ("`geofolder'"=="`c(sysdir_personal)'maptile_geographies") di as text `"To see a list of installed geographies run: {stata maptile_geolist}"'
else {
di as text `"To see a list of installed geographies run:"'
di as text `" {stata maptile_geolist, geofolder(`geofolder')}"'
di as text ""
}
exit 198
}
* Check that it has a help file
cap confirm file `"`geofolder'/`geography'_maptile.smcl"'
if (_rc!=0) {
di as error `"{bf:`geography'} geography exists, but it does not have a help file. There is no file:"'
di as text `" `geofolder'/`geography'_maptile.smcl"'
exit 198
}
* Display the help file
if ("`c(console)'" == "console") type `"`geofolder'/`geography'_maptile.smcl"'
else view `"`geofolder'/`geography'_maptile.smcl"'
end