Download The ARC/INFO Application Development Primer

Transcript
Innovative GIS Solutions
Page 78
&severity &error &routine bailout
/*
/* Check arguments
&if ^ [NULL %routine%] &then
&call %routine%
&else
&call init
&return
/*----------&routine INIT
/*----------&call initialize
&call menu
&return
/*----------&routine INITIALIZE
/*----------/*
INSERT ANY TOOL INITIALIZATION STATEMENTS HERE
&return
/*----------&routine MENU
/*----------/* Accept as 1st two args the position of the menu
/* and the stripe (title text) of the menu
/*
/* To launch a menu simply set the .ra$thr$* variables below.
/* The thread manager will manage the thread startup etc.
/*
/* The following variables are required:
/* .ra$thr$pos
Position
/* .ra$thr$str
Menu stripe
/* .ra$thr$size
Size (null is default – extent of menu)
/* .ra$thr$menu
AML menu file (no extension)
/* .ra$thr$pin
PIN action
/* .ra$thr$modal Set modality (null for no, „modal‟ for modal menu)
/* .ra$template$stripe_min 10 character name for menu minimize (UNIX)
/*
&set position = [EXTRACT 1 [UNQUOTE %arglist%]]
&set stripe = [EXTRACT 2 [UNQUOTE %arglist%]]
&if [NULL %position%] or %position%_ = #_ &then
&set .ra$thr$pos [quote &ul &thread menubar &ll];
&else
&set .ra$thr$pos %position%
/*
&if [NULL %stripe%] or %stripe%_ = #_ &then
&sv .ra$thr$str template tool
&else
&set .ra$thr$str [quote [unquote %stripe%]]
The ARC/INFO Application Development Primer