home *** CD-ROM | disk | FTP | other *** search
- Making Life Easier with Macros
-
- David Rose
- Pacific Northwest PC Users Group
-
- One of the most potent, yet least
- understood, areas of software is the
- Macro. Programmers may have a passing
- acquaintance with the concept, but
- most only wonder what it means. The
- Macro concept is pretty simple at
- first, although it can grow into a
- full-blown research topic,
- intimidating even information
- scientists.
-
- To explain the Macro, let's begin
- with terms already familiar to most
- computer users: variable names,
- language keywords and DOS commands.
- What do these have in common? They
- are all "words" in a sense, like the
- words we're all accustomed to in
- English. Words identify, label, name
- or stand for things, values, actions,
- ideas,....
-
- Macro is just a new category of words
- in this case, a word that stands for
- a text string, or some other words.
- Think of a Macro as a word with its
- accompanying definition in a
- glossary. How is this different from
- other words? The difference is in
- what's done with the word. When a
- command word is recognized by DOS, it
- does something - like COPY or RENAME.
- When a variable name is recognized by
- BASIC, it (usually) fetches/stores
- the named value. When a keyword is
- recognized, BASIC takes some action,
- like PRINT or GOSUB.
-
- When a Macro name is recognized by a
- Macro processor, it substitutes the
- definition for the word. As far as
- the rest of the computer is
- concerned, the definition was typed,
- not the word. This wouldn't be
- terribly interesting or useful except
- for where the Macro processor lies.
- It lies between the application
- program (WordStar, VisiCalc, etc.),
- and the keyboard; and since the
- keyboard is your principal input
- device, that means between the
- programs and YOU.
-
- Macro definition can actually grow
- into a completely specialized
- programming language for expressing
- how to translate human-oriented
- discourse into computer gibberish.
-
- Of course, now we're dealing with
- another language, and perhaps you are
- already saturated with BASIC, DOS,
- etc. So, is it worth it? You bet it
- is! First, the Macro language is
- specialized and has a rather small
- vocabulary compared with most others;
- not too much for you to learn.
- Second, its purpose is to make life
- easier, and it succeeds. The time
- spent learning to make Macros is
- quickly won back by using them. As
- you gain proficiency, you can
- progressively improve the quality of
- your human to computer interface
- until you have it customized just as
- you want it. Thus, the Macro becomes
- one of your most potent and flexible
- tools for transforming the general
- purpose computer into special purpose
- tools.