1, Building blocks Internal (in AML) [] function & directive % % variable ~ (at end of line) continue on next line ~ (at start of line) NO interpretation : multi cmds on same line - separator */ comment in AML (! !) repeat cmd for each element in paren list {! !} expand one cmd with all elements in paren list External (at arc: prompt) &run (&r) run an AML &runwatch run an unconverted file.wat &watch copy arc cmds to file.wat &watch &off turn off watch &watch &append add to existing file.wat &watch &coordinates for cursor coord from MOVE *, IDENTIFY *, ... &cwta &CONV_WATCH_TO_AML file.wat file.aml &encode &encrypt creates unreadable .EAF/.EMF file - paranoids &encode &listheader to see 1 line header of encoded file &setvar := value name is not case-sensitive; value is &set = value 4 values: string, integer, real, boolean &sv(&s) value Words 25000 .75 .TRUE./.FALSE. &listvar (&lv &l) show current variables: local, .global, program &listlocal (&ll) show local variables &listglobal (&lg) show global variables (var .name) %% refer to a set variable ex: &s cover = CENSUS &s .type = POLY note: .global &s exten = PAT &s count = 4 list %cover%%count%.%exten% %.type% gives list CENSUS4.PAT POLY reserved names: dsc$ cover info pnt$ screen location aml$ aml status &abbreviations &on turn on abbreviations for an arc session &describe Arc directives (&) &return must be at end of an AML &args {arg1} {arg2} command line arguments (&r the.aml arg1 agr2) &terminal (&term) terminal characteristics (9999) &fullscreen manage screen listings (&popup) &type \ type to screen ( \ inserts a blank line ) &workspace change workspace &system (&sys) operating system command &usage <&cmd> help &commands <&letter> commands begining with letter &if &then &else if-then &do &end do block &do := &to &by for-next &do &while &end do-while &do &until &end do-until &do & &list do list &select &when &otherwise &end switch Functions ( [ [] ] ) [query] asks yes/no and retrieves responce [responce] asks for info and retrieves value [exists] returns .true. if (cover, file) exists else not [null ] returns .true. if item has no value/blank [translate] conv lowercase string to uppercase [locase] conv uppercase string to lowercase [calc] preforms +, -, *, /, ^ [extract] extracts specific element from a string [length] returns number of characters in string [show] see AML Users Guide for all [open] open a system file for read or write [read] reads a record from and open file [date -time] date with time flag [date -dow] date with day of the week option ex: &type Hi [username], today is [date -cal] &s shade [responce 'Enter a symbol number:'] polygonshades landuse [calc %shade% + 100] moveitem par_owner = [translate [response 'Who']] &do i = 1 &to .1 &by -.1 &r oper.aml &end &do &while not %done% &r oper.aml &s done [query 'Done?' ~ .true.] &end &do cover &list roads streams contours arcs %cover% &end note interpret order: %var% [function] &directive 2. Point 'n Click Simple menus All [get...] -sort sort choices in acending order -none include _none_ as option -other include _other_ as choice w/value prompt [getcover] * covers -cover-type feature types (all, poly, line, subclas) [getfile] * files/dirs -type file/dir types (info, sys, workspaces) -noextention no extention displayed [getgrid] * grids [getitem] -item_class item class (ordinary, refined, or both) -item_type item type (character, numeric, integer) [getlibrary] -library; map libraries -tile; -layer map tiles; map layers [getsymbol] -line; -shade; line symbols, shade symbols -marker; -text marker symbols, text symbols [gettin] * tins [getunique] unique items in FAT or other info file [getchar] (no menu) prompt for char from keyboard ex: &sv cov = [getcover * -poly] = [getcover /gis/spud/dem/zone*] &s file = [getfile '/gis/*.lut' -info] = [getfile *.lut -info 'Choose lookup table' -none] &s item = [getitem %cover% -poly -integer] polygonshade %cover% %item% &s symb = [getsymbol -shade -range 1-25] &set it = [getunique poles -point height -other] &s user = [getchoice bob al don cal -prompt 'Who?' -sort] &s symb = [getsymbol -%type%] Menu Interface Choice actions are seperated by ; Max commands per choice: 6,144 char Maximum choices: 150 Main menu: 20 Each choice: 32 char [menu] may return just a single value Force menu type: &menu the.menu { &sidebar | &pulldown } Menu must have as first executable lines a) menu type 1=Pulldown 2=Sidebar 3=Matrix 4=Key 5=Tablet 6=Digitizer 7=Form b) orientation and position on screen 0 = horizontal 1 = Vertical c) instruction/title -1 = left 0 = center 1 = right Matrix max choices: 100 Each choice: 32 char Total char: 4.096 Title: 80 Cmd position: &menu the.menu &pulldown { &ur | &cc | &lr | &uc | &cr | ...} Title bar/stripe: &menu the.menu &matrix &position &ll &stripe 'The Project' Menu size: &menu the.menu &matrix &position &cl &size 350 175 Only Pulldown~Sidebar and Tablet~Digitizer may be interchanged ** arc.aml ** is a startup AML program. Likewise arcedit.aml and arcplot.aml. Also gird.aml and librarian.aml ... Looking for code &workspace takes presidence over following for search &amlpath up to 20 pathnames - not program specific - use &r &menupath up to 20 pathnames - use &menu &atool up to 20 - user paths 1st - program specific - cmd form - anywhere in session atool directories are program specific (arc, arcedit, arcplot) If-then, operands and logical Basic operation equivaents = EQ Equal to <>;^= NE Not equal to > GT Greater than >= GE Greater than or equal to < LT Less than <= LE Less than or equal to CN Contained in NC Not contained in IN Included in (a set or range) LK Like (a wildcard (*) match) &describe dsc$qedit Set to .true. if cover was edited since last topo const dsc$qtopology Set to .true. if there is a polygon topology dsc$full_cover Set to the full pathname of the cover dsc$arcs Set to the number of arcs in a coverage dsc$precision Set to the precision of the cover (single or double) note: &if <> &then &do &end but &select <> &when <> ; &do &end &otherwise [keyword] matches upper. lower, and unique ex: /* selectfeature.aml &s cover = [getcover] mape %cover% &select [keyword [response 'Feature type (Arc | Poly | Point)'] ~ Arc | Poly | Point] &when 1 arcs %cover% &when 2 polys %cover% &when 3 points %cover% &otherwise &type Invalid feature type.\Try again. &end /* select &return AND, OR, XOR (one but not both), NOT (^) [type] -2 = real -1 = int 1 = char 2 = boolean Do loops Counted &do = &to &by &end List &do &list &end While &do &while &end Until &do &until &end <- done at least once [listitem] creates list from info table [value ] var value Coordinates Point buffer takes presidence. Max points: 500 points pnt$x x-location of cursor pnt$y y-location of cursor pnt$key key pressed to enter &getpoint gets a point and stores in pnt$ variables &page in page units &map in map units (default) &push add point to buffer &getlastpoint set pnt$ variables to last input coords &pushpoint loads a pointset into the buffer &flushpoints clears the buffer Math [abs] absolute value [calc] returns result of numeric or logical expr [cvtdistance] conv metric units to meters and imperial to feet [invdistance] distance between two points [max] returns greater of two numbers [min] returns lesser of two numbers [mod] remainder of integer div (modulus) [okdistance] is distance in valid arc form? [round] rounds real (.5 rounds up) [sqrt] square root [truncate] truncate real to int Trig (Arc computes all angles in radians) [sin] sine (A) = y/d /| [cosine] cosine (A) = x/d / | [tangent] tangent (A) = y/x d / | [asin] arcsine (y/d) = A / | [acos] arccosine (x/d) = A / A | y [atan] arctan (-+pi/2) (y/x) = A /_____| [atan2] arctan (-+ pi) (y/x) = A x [angrad] conv arc form A in degrees to radians [radang] conv A in radians to valid arc form [invangle] polar A between two points (in radians) [okangle] is valid arc angle? [radang] conv A in radians to valid arc form ex: &s angle = [sin [angrad 60]] Strings &listvar (&lv) for verbatium of string contents &format set real number decimal places (default 3) - AML useless [pathname] for full pathname [dir] for dir part of name [entryname] for filename [quote] put quotes around str [unquote] removes quotes from str Use '' for an apostrophe inside a quoted string. Info has its own format. [subst] substitute str for another [trim] remove char for str ends [format] string display format [index] returns left-most occurance of str [keyword] returns position of keyword in list [length] str lenght [null] null str? [search] returns position of 1st char of search str in target str [verify] returns position of 1st nonmatch [after] returns str after 1st occur of search in target [before] retunrs str befor 1st occur of search in target [extract] extracts elemnet from list [substr] extracts substr from str at position ex: &format 2 ; &type [format 'x = %1% y = %2%' %pnt$x% %pnt$y%]