home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 24 / CD_ASCQ_24_0995.iso / dos / tools / aurora21 / template.dat < prev    next >
Text File  |  1995-08-10  |  4KB  |  198 lines

  1.  
  2. Template Data File
  3. ------------------
  4. Template editing allows you include commonly-used blocks of code or text
  5. (called 'templates') into the current file with just a few keystrokes.
  6. Templates are selected based on the current file extension, and may
  7. contain program code, text, or even macro expressions.
  8.  
  9. This data file contains sample AML and C/C++ templates for use with the
  10. TEMPLATE.AML macro, and must be placed in the MACRO subdirectory. You
  11. can easily modify this file for use with other languages or text files.
  12.  
  13. Templates must be defined in the following format:
  14.  
  15. template_keyword.extensions  [lines_in_the_template]
  16. [template data]
  17. [template data]
  18.  :
  19.  :
  20.  
  21. The template keyword must begin in column one. [lines_in_the_template]
  22. is only required when the template data contains blank lines, otherwise
  23. the template data is delimited by the next blank line. A '\c' in the
  24. template data indicates the position in the template where the cursor
  25. should be placed when the template is used. For example:
  26.  
  27.   // if-then-end
  28.   if.aml
  29.   if \c then
  30.   end
  31.  
  32. To use a template, type in the template keyword and press the template
  33. expansion key (<ctrl f3> is the default). The template macro will select
  34. the appropriate template from this file, based on the extension of the
  35. file you are editing.
  36.  
  37. Templates defined in TEMPLATE.DAT with an extension of '.' (no
  38. extension) are active in files with any extension. For example:
  39.  
  40.   // the 'etc' template works in any file:
  41.   etc.
  42.   et cetera
  43.  
  44. Templates can also be enabled for multiple file extensions by listing
  45. each extension after the template keyword. For example:
  46.  
  47.   // the 'struct' template is enabled in .C, .CPP, and .H files:
  48.   struct.c.cpp.h
  49.   typedef struct {
  50.   } \c;
  51.  
  52. Macro expressions may be also be embedded within a template. When a
  53. template containing macro expressions is used, each macro expression in
  54. the template will be evaluated and replaced with its value. Embedded
  55. expressions must be entered in the following format: \{expression}.
  56. For example:  The date and time is \{gettime + getdate}
  57.  
  58. ========================================================================
  59.  
  60. -- AML Templates -------------------------------------------
  61.  
  62. // case statement
  63. ca.aml
  64. case \c
  65.   when
  66.   when
  67.   otherwise
  68. end
  69.  
  70. // databuf-end
  71. db.aml
  72. databuf "\c"
  73. end
  74.  
  75. // define-end
  76. de.aml
  77. define
  78.   \c
  79. end
  80.  
  81. // function-end
  82. fu.aml
  83. function \c
  84. end
  85.  
  86. // if-else-end
  87. if.aml
  88. if \c then
  89. else
  90. end
  91.  
  92. // key-end
  93. ke.aml
  94. key <\c>
  95. end
  96.  
  97. // loop-end
  98. lo.aml
  99. loop
  100.   \c
  101. end
  102.  
  103. // menu-item-end
  104. me.aml
  105. menu "\c"
  106.   item ""
  107.   item ""
  108. end
  109.  
  110. // repeat-until
  111. re.aml
  112. repeat
  113.   \c
  114. until
  115.  
  116. // while do-end
  117. wh.aml 3
  118. while \c do
  119.  
  120. end
  121.  
  122.  
  123. -- C/C++ Templates -----------------------------------------
  124.  
  125. // class
  126. cl.c.cpp.h
  127. class \c {
  128.   protected:
  129.   public:
  130. }
  131.  
  132. // do while
  133. do.c.cpp
  134. do {
  135.   \c
  136. }
  137. while ();
  138.  
  139. // for
  140. fo.c.cpp
  141. for (\c;;) {
  142. }
  143.  
  144. // if
  145. if.c.cpp
  146. if (\c) {
  147. }
  148.  
  149. // function
  150. fu.c.cpp
  151. void \cfunc (void)
  152. {
  153. }
  154.  
  155. // main
  156. ma.c.cpp
  157. void main(void) {
  158.   \c
  159. }
  160.  
  161. // struct
  162. st.c.cpp.h
  163. typedef struct {
  164. } \c;
  165.  
  166. // switch
  167. sw.c.cpp
  168. switch (\c) {
  169.   case :
  170.     break;
  171.   case :
  172.     break;
  173. }
  174.  
  175. //union
  176. un.c.cpp.h
  177. union {
  178. } \c;
  179.  
  180. // while
  181. wh.c.cpp
  182. while (\c) {
  183. }
  184.  
  185.  
  186. -- Templates for any file extension ------------------------
  187.  
  188. // sample 'tagline' template - illustrates embedded macro expressions
  189. // (this template requires the macro "tagline" and the file "taglines.dat")
  190. tag.
  191. +-------------------------------------+-----------------------------------+
  192. | John Doe                            |  Tel.   123-456-7890              |
  193. | XYZ Enterprises                     |  Fax:   987-654-3210              |
  194. | 1234 Oak Street                     |  Email: john.doe@xyz.com          |
  195. | Washington, DC 20015  USA           |                                   |
  196. +-------------------------------------+-----------------------------------+
  197. * Message composed with Aurora v\{getversion}, \{gettime + ' ' + getdate}
  198.