home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / MISC / TNH_PC.ZIP / ROSE.NL < prev    next >
Encoding:
Text File  |  1987-01-14  |  2.8 KB  |  86 lines

  1. Making Life Easier with Macros
  2.  
  3.               David Rose
  4.    Pacific Northwest PC Users Group
  5.  
  6. One of the most potent, yet least
  7. understood, areas of software is the
  8. Macro. Programmers may have a passing
  9. acquaintance with the concept, but
  10. most only wonder what it means. The
  11. Macro concept is pretty simple at
  12. first, although it can grow into a
  13. full-blown research topic,
  14. intimidating even information
  15. scientists.
  16.  
  17. To explain the Macro, let's begin
  18. with terms already familiar to most
  19. computer users: variable names,
  20. language keywords and DOS commands.
  21. What do these have in common?  They
  22. are all "words" in a sense, like the
  23. words we're all accustomed to in
  24. English. Words identify, label, name
  25. or stand for things, values, actions,
  26. ideas,....
  27.  
  28. Macro is just a new category of words
  29. in this case, a word that stands for
  30. a text string, or some other words.
  31. Think of a Macro as a word with its
  32. accompanying definition in a
  33. glossary. How is this different from
  34. other words?  The difference is in
  35. what's done with the word. When a
  36. command word is recognized by DOS, it
  37. does something - like COPY or RENAME.
  38. When a variable name is recognized by
  39. BASIC, it (usually) fetches/stores
  40. the named value. When a keyword is
  41. recognized, BASIC takes some action,
  42. like PRINT or GOSUB.
  43.  
  44. When a Macro name is recognized by a
  45. Macro processor, it substitutes the
  46. definition for the word. As far as
  47. the rest of the computer is
  48. concerned, the definition was typed,
  49. not the word. This wouldn't be
  50. terribly interesting or useful except
  51. for where the Macro processor lies.
  52. It lies between the application
  53. program (WordStar, VisiCalc, etc.),
  54. and the keyboard; and since the
  55. keyboard is your principal input
  56. device, that means between the
  57. programs and YOU.
  58.  
  59. Macro definition can actually grow
  60. into a completely specialized
  61. programming language for expressing
  62. how to translate human-oriented
  63. discourse into computer gibberish.
  64.  
  65. Of course, now we're dealing with
  66. another language, and perhaps you are
  67. already saturated with BASIC, DOS,
  68. etc. So, is it worth it? You bet it
  69. is!  First, the Macro language is
  70. specialized and has a rather small
  71. vocabulary compared with most others;
  72. not too much for you to learn.
  73. Second, its purpose is to make life
  74. easier, and it succeeds. The time
  75. spent learning to make Macros is
  76. quickly won back by using them. As
  77. you gain proficiency, you can
  78. progressively improve the quality of
  79. your human to computer interface
  80. until you have it customized just as
  81. you want it. Thus, the Macro becomes
  82. one of your most potent and flexible
  83. tools for transforming the general
  84. purpose computer into special purpose
  85. tools.
  86.