Customizing PC ARC/INFO 3.5.X


Startup SMLs

SML, or Simple Macro Language, is the scripting language for PC ARC/INFO. An SML macro can be as simple as a list of commands to carry out a repetitive task, as is the case with UNPACKM.SML (described in "Installing PC ARC/INFO 3.5.X in Windows 95").

UNPACK MODULE STARTER
UNPACK MODULE DATACON
UNPACK MODULE ARCEDIT
UNPACK MODULE OVERLAY
UNPACK MODULE ARCPLOT
UNPACK MODULE NETWORK
SMLs in the current directory or the %ARC%\UTOOL directory may be executed at most command prompts:

: &r SNAP
PC ARC/INFO allows startup scripts. Typically, startup scripts may execute a shell, program function keys, reposition windows, and so forth; they can be passed as an argument to a particular command or module:

[ARC] ARCPLOTW DISP5
Also, if an SML exists in the current directory or the %ARC%\UTOOL directory which is named after a particular module, it will be run automatically when that module is executed. For example, if an SML named ARCEDIT.SML exists, it will be run upon starting ARCEDIT or ARCEDITW. (This does not apply to compiled SML, or CML, files -- if ARCEDIT.CML were present, it would be ignored.) If another script is passed as an argument, the default startup script is ignored.

To execute a startup script for the ARCW prompt, it needs to be added as an argument to the shortcut's command line. For example, to execute ARC.SML (discussed in the next section) every time ARCW is started, you can add it to the ARCW command line:

Adding ARC.SML to the ARCW Shortcut


Defining Function Keys

Commonly used commands may be assigned to function keys using the &SETKEY command:

Usage: &SETKEY [key] {string} {CR / &CR}
[WARNING: ANSI.SYS must be installed in CONFIG.SYS:

   devicehigh=c:\windows\command\ansi.sys
before &SETKEY can be used.]

For example, to assign the string "describe " to <F2>, you would execute the following:

&SETKEY F2 "describe "
Note the space at the end of the string; this allows the user to type in an argument immediately after pressing <F2>. To assign "arcplotw qcheck" plus a carriage return to <Alt><F1>, you would execute the following:

&SETKEY A1 "arcplotw qcheck" &cr
Assignments can also be made to function keys combined with <Shift> ("S1") and <Control> ("C1").

ARC.SML is a startup SML for the ARCW prompt (see previous section). It sets the following function key definitions:

Key                     Alt                Shift          Ctrl
--------------------------------------------------------------------
 1  arceditw aeshell    arcplotw qcheck    @arcwkey
 2  describe            Invert Background
 3  build               Print
 4  nodeerrors          Fonts...
 5  labelerrors
 6  createlabels
 7  tables
 8  additem
 9  dropitem
10  frequency
ARCWKEY.SML, which is executed by pressing <Shift><F1>, displays the above table.


Customizing ARC Commands

Commands that are executed at the ARCW prompt are stored as batch files in the %ARC%\PTOOL directory. They may be copied to create synonyms, for example:

C:\ARCEXE\PTOOL>COPY ARCEDITW.BAT AE.BAT
creates a synonym "AE" for ARCEDITW. Other convenient synonyms include:

COPY ARCPLOTW.BAT AP.BAT
COPY COPYCOV.BAT COPY.BAT*
COPY LISTCOVS.BAT LC.BAT
COPY RENAMCOV.BAT RENAME.BAT
*You will want to add this only if you are in the habit of using XCOPY or CP to copy files.

You can also rename a batch file to eliminate an unwanted command or synonym. For example, if you wish to be able to run the text editor EDIT at the ARCW prompt, you can rename EDIT.BAT to something else:

REN EDIT.BAT EDITCOV.BAT
If you plan only to use Windows versions of certain modules, you can rename the DOS module batch file and copy the Windows module batch file to the DOS name:

REN ARCEDIT.BAT ARCEDITD.BAT
COPY ARCEDITW.BAT ARCEDIT.BAT
Also, in Windows 95, you may invoke the Windows help file from the ARCW prompt by renaming HELP.BAT to DOSHELP.BAT:

REN HELP.BAT DOSHELP.BAT
and creating the following HELP.BAT:

ECHO OFF
WECHO [PC ARC/INFO 3.5.1 HELP - 01/24/97]
WINHELP %ARC%/HELP/PCARCWIN.HLP

Customizing ARCEDITW Commands

Although you may get into the habit of using a shell (such as WEDIT or AESHELL) in your ARCEDITW sessions, there are times when it is more convenient to work at the command prompt. Unfortunately, many of ARCEDITW's commands are somewhat unwieldy to type on a frequent basis. Normally you can abbreviate a command to the shortest unique string and still have it recognized. However, if that string is a subset of one or more command entries in the VOCAB file (for example, LI for LIST is common with LINESET and LINEINDEX), you will receive the message:

LI is ambiguous
Unrecognized command.
Or, you may desire to use certain command abbreviations which are not a substring of the command (e.g. EC for EDITCOVERAGE).

[NOTE: Some synonyms are already supported by ARCEDITW (for example, ED for EDITDISTANCE, EF for EDITFEATURE, RB for REMOVEBACK, RES for RESELECT, and SD for SNAPDISTANCE).]

The way to solve both problems is to create a synonym entry in the VOCAB file. Residing in the %ARC%\VOCAB directory are files which define the command set and various tokens which the command processor will recognize. If you examine a VOCAB file, you will notice that each entry has a code number associated with it. Command codes are less than 1000; synonym codes are equal to the command code + 8000. A synonym may be a unique or nonunique substring.

For example, EDITCOVERAGE has the following definition:

EDITCOVERAGE         202
To add "EC" as the synonym, you would add the following line:

EC                  8202
[WARNING: In other words, be careful when you change VOC files, and keep a backup. Also, note that in version 3.5 changes made to a VOC file will affect both DOS modules and Windows extensions (version 3.5.1 maintains separate VOC files).]

Click HERE for a sample vocab file for ARCEDITW that adds the following synonyms:

Synonym   Command

BC        BACKCOVERAGE
BE        BACKENVIRONMENT
CP        COPY
DA        DELETEARROWS
DE        DRAWENVIRONMENT
DEL       DELETE
DS        DRAWSELECT
EC        EDITCOVERAGE
LI        LIST
MI        MOVEITEM
MV        MOVE
RE        REMOVEEDIT
SA        SETARROW
In version 3.5, rename ARCEDIT.VOC to ARCEDIT.OLD and copy the new file to ARCEDIT.VOC. In version 3.5.1, rename ARCEDITW.VOC to ARCEDITW.OLD and copy the new file to ARCEDITW.VOC.


Return to ArcTips page