T
T
h
h
e
e
A
A
R
R
C
C
/
/
I
I
N
N
F
F
O
O
A
A
p
p
p
p
l
l
i
i
c
c
a
a
t
t
i
i
o
o
n
n
D
D
e
e
v
v
e
e
l
l
o
o
p
p
m
m
e
e
n
n
t
t
P
P
r
r
i
i
m
m
e
e
r
r
A
A
n
n
O
O
v
v
e
e
r
r
v
v
i
i
e
e
w
w
o
o
f
f
A
A
p
p
p
p
l
l
i
i
c
c
a
a
t
t
i
i
o
o
n
n
D
D
e
e
v
v
e
e
l
l
o
o
p
p
m
m
e
e
n
n
t
t
M
M
e
e
t
t
h
h
o
o
d
d
o
o
l
l
o
o
g
g
i
i
e
e
s
s
f
f
o
o
r
r
A
A
R
R
C
C
/
/
I
I
N
N
F
F
O
O
This workbook provides an overview of application development methodologies available for the
ARC/INFO GIS.
1
The primer reviews different approaches and issues related to developing
custom applications with the ARC/INFO platform. This book is intended for existing ARC/INFO
users who have some experience with application development and programming. It will be
particularly useful for application developers familiar with the Arc Macro Language (AML) and
ARC/INFO command operation. It is not intended for the casual or novice ARC/INFO user.
Suite 300
2000 S. College Ave.
Fort Collins, CO 80525
Telephone: (970) 490-5900
FAX: (970) 490-2300
E-mail: igis@innovativegis.com
Visit us on the Web at http://www.innovativegis.com
1
ARC/INFO, Arc Macro Language, AML are registered trademarks of Environment Systems Research
Institute, Inc, (ESRI), Redlands, CA.
Innovative GIS Solutions Page 2
The ARC/INFO Application Development Primer
Table of Contents
P
P
r
r
e
e
f
f
a
a
c
c
e
e
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
6
6
1
1
.
.
0
0
O
O
v
v
e
e
r
r
v
v
i
i
e
e
w
w
o
o
f
f
t
t
h
h
e
e
A
A
R
R
C
C
/
/
I
I
N
N
F
F
O
O
P
P
r
r
o
o
d
d
u
u
c
c
t
t
L
L
i
i
n
n
e
e
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
9
9
1.1 AML – ARC/INFO‟s Glue ................................................................................ 12
1.2 Module languages .......................................................................................... 13
2
2
.
.
0
0
T
T
h
h
e
e
A
A
r
r
c
c
M
M
a
a
c
c
r
r
o
o
L
L
a
a
n
n
g
g
u
u
a
a
g
g
e
e
–
–
A
A
M
M
L
L
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1
1
6
6
2.1 Basic Operating Principles ............................................................................ 16
2.1.1 Directives ................................................................................................... 17
2.1.2 Variables .................................................................................................... 17
2.1.3 Functions ................................................................................................... 18
2.1.4 Functional Groups ..................................................................................... 19
2.2 Organizing Applications – An Application Development Methodology .... 19
2.2.1 RAPiD AML – An Example ADM ............................................................... 20
Meta-Data Tables ........................................................................................................21
2.2.2 The ATOOL Approach ............................................................................... 25
2.3 File Management Issues ................................................................................ 26
2.3.1 Pathing & Environment Variables ............................................................. 26
2.3.2 Individual User Startup Files ...................................................................... 29
2.3.3 System Startup Files ................................................................................. 30
2.3.4 Version control ........................................................................................... 30
Development versus Production versions....................................................................31
Encrypting AML Programs ..........................................................................................31
2.4 Workspace / Data Management Issues ......................................................... 32
2.4.1 Environment Variables............................................................................... 32
2.4.2 Data and Code Separation – Workspace Independence ........................... 33
2.5 Macro Development ....................................................................................... 33
2.5.1 Coding Methodologies ............................................................................... 33
ArcTools Coding Standards ........................................................................................33
Multiple Entry Point Approach .....................................................................................35
An Example Toolset – getsymset.aml .........................................................................37
Using AML Templates .................................................................................................39
2.5.2 Using Variables ......................................................................................... 40
Error Handling and Trapping .......................................................................................42
Limits ..........................................................................................................................42
2.5.3 ArcTools - Source Toolsets ....................................................................... 43
2.5.4 Key AML Functions and Directives ............................................................ 46
2.6 GUI Development ........................................................................................... 48
2.6.1 Menu Options ............................................................................................ 48
Innovative GIS Solutions Page 3
The ARC/INFO Application Development Primer
2.6.2 Creating Menus ......................................................................................... 52
Formedit (type 7 menus) .............................................................................................52
Menuedit (type 8 menus) .............................................................................................54
2.6.3 Menu Standards ........................................................................................ 55
Menus and Threads ....................................................................................................55
A Thread Manager ......................................................................................................57
Modality ......................................................................................................................58
Scroll Lists ...................................................................................................................59
Widgets Organization ..................................................................................................61
2.7 Linking ARC/INFO to External Programs ..................................................... 62
2.7.1 System Calls - &SYSTEM ......................................................................... 63
2.7.2 IAC – Inter-Application Communication ..................................................... 64
3
3
.
.
0
0
O
O
p
p
e
e
n
n
D
D
e
e
v
v
e
e
l
l
o
o
p
p
m
m
e
e
n
n
t
t
E
E
n
n
v
v
i
i
r
r
o
o
n
n
m
m
e
e
n
n
t
t
–
–
O
O
D
D
E
E
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
6
6
6
6
3.1 Role of AML functions and code ................................................................... 66
3.2 Direct ARC/INFO Command Calls ................................................................. 67
3.3 GUI Options .................................................................................................... 67
3.3.1 Visual Basic ............................................................................................... 67
3.3.2 Windows Controls vs AML Widgets ........................................................... 70
3.4 OLE / ActiveX Development Strategies ........................................................ 73
4
4
.
.
0
0
R
R
e
e
f
f
e
e
r
r
e
e
n
n
c
c
e
e
s
s
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
7
7
3
3
General Information ................................................................................................. 73
Books ........................................................................................................................ 73
Courses ..................................................................................................................... 74
A
A
p
p
p
p
e
e
n
n
d
d
i
i
x
x
A
A
–
–
S
S
a
a
m
m
p
p
l
l
e
e
A
A
M
M
L
L
T
T
o
o
o
o
l
l
s
s
e
e
t
t
H
H
e
e
a
a
d
d
e
e
r
r
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
7
7
5
5
A
A
p
p
p
p
e
e
n
n
d
d
i
i
x
x
B
B
–
–
E
E
x
x
a
a
m
m
p
p
l
l
e
e
T
T
o
o
o
o
l
l
s
s
e
e
t
t
T
T
e
e
m
m
p
p
l
l
a
a
t
t
e
e
F
F
i
i
l
l
e
e
s
s
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
7
7
6
6
A
A
p
p
p
p
e
e
n
n
d
d
i
i
x
x
C
C
–
–
E
E
x
x
a
a
m
m
p
p
l
l
e
e
A
A
M
M
L
L
T
T
o
o
o
o
l
l
s
s
e
e
t
t
–
–
g
g
e
e
t
t
s
s
y
y
m
m
s
s
e
e
t
t
.
.
a
a
m
m
l
l
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
8
8
3
3
Innovative GIS Solutions Page 4
The ARC/INFO Application Development Primer
List of Tables and Figures
Table 1 : Summary of Terms ...................................................................................................... 9
Table 2 : ESRI Product Line API Characteristics .......................................................................12
Table 3 : Summary of ARC/INFO‟s Primary Subsystems and Modules .....................................13
Figure 1 : A Typical Meta-Data Definition for Application Management .....................................21
Figure 2: The main application development interface for RAPiD*AML presents existing
applications, and their versions, assigned for the current user. Applications are assigned
based on user name and access is inherent in the list of available applications. ................23
Figure 3: Additional tools are required to help Developers manage existing applications, and
versions, or create new applications. .................................................................................24
Figure 4: The default application desktop with RAPiD*AML is comprised of a main form menu,
with 10 assignable buttons, an embedded pulldown menu for generic tools, a graphics
display window, and the application developer tools. Upon entering a new application for
the first time a welcome message is displayed reviewing options for customizing the startup
of the application using the a startup macro. ......................................................................24
Figure 5: Routines Used by the "getsymset" toolset. .................................................................37
Table 4 : General ArcTools Utility Tools ....................................................................................44
Figure 6 : The ArcTools Tool Browser provides a mechanism for programmers to review
available tools. Tools are organized by functional libraries (subdirectories). .......................45
Figure 7: Sample menu tool in both source ASCII format and GUI form. ...................................49
Figure 8: An example form menu with an embedded type 8 menu. Using such a nested main
menu provides application developers with options to build application interfaces without
using multiple menus. Application capabilities can now be categorized using standard
Windows conventions. .......................................................................................................51
Figure 9: A typical UNIX FormEdit session. The top window is the FormEdit widget control
menu, while the lower window is the custom menu canvas for the menu being edited. The
example toolset “getsymset” is shown. ...............................................................................53
Figure 10: The Windows NT version of FormEdit provides a more intuitive drag-and-click
interface as a standalone program. A standard Windows program interface is utilized with
menu controls available as toolbars. ..................................................................................53
Figure 11: The MenuEdit program is a GUI interface for creating type 8 menus. It operates as a
standalone program, or from within FormEdit to supported embedded menus in type 7 form
menus. ...............................................................................................................................54
Figure 12: Example modal thread. ............................................................................................59
Figure 13: A typical toolset that uses scroll lists populated by ASCII files, and global variables, to
present selection options to the user. This tool allows the user to build a logical attribute
expression query by selecting coverage attributes from a scroll list populated by an ASCII
file. .....................................................................................................................................59
Innovative GIS Solutions Page 5
The ARC/INFO Application Development Primer
Figure 14: This figure illustrates the X-11 Windows "bitmap" program used to create and edit
bitmaps on UNIX platforms. ...............................................................................................62
Figure 15: This example illustrates a re-coding of the “getsymset” AML toolset reviewed earlier
in the AML chapter of the workbook. Note how the tool is now configured with an ArcPlot
canvas to display symbol sets. ...........................................................................................68
Figure 16: The standard UNIX AML version of the toolset menu utilizes BUTTON widgets to
select the number of partitions, and the active partition to display in. Icons are used as
DISPLAY fields to echo the current active partition for the ArcPlot window. .......................68
Figure 17: This menu illustrates the Multi-Window AML menu code displayed under Windows
NT. .....................................................................................................................................69
Figure 18: This GUI represents a re-coding of the Multi-Window toolset menu using Visual Basic
and ODE techniques. .........................................................................................................69
Figure 19: This menu illustrates the current menu widgets/controls available with AML on either
UNIX or Windows NT (shown). ..........................................................................................71
Figure 20: This menu illustrates the menu controls available under Visual Basic, and hence
available to ARC/INFO applications under ODE.................................................................72