home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / stubs.zip / stubs.txt < prev   
Text File  |  1995-04-05  |  4KB  |  89 lines

  1. STUBS v2.0 - Program Code Stub Creation
  2. =======================================
  3.   Initial version by Paul Gallagher 1995.
  4.  
  5. This REXX script is hereby placed in the public domain. Any changes
  6. should be adequately documented, and authorship notices of prior
  7. versions retained. As a courtesy, please e-mail modified files to
  8. previous authors.
  9.  
  10. Contents of this file:
  11.   * Version History
  12.   * Contacting the authors
  13.   * System Requirements
  14.   * About STUBS
  15.   * Using STUBS
  16.  
  17. Version History
  18. ===============
  19.  
  20. 95.03.09 : v2.0
  21.   - initial release, published in EDM/2 Vol 3 No 3
  22.     "REXX, the developer's best friend"
  23.  
  24. Contacting the Authors
  25. ======================
  26. Paul Gallagher: Internet (paulpg@ibm.net)
  27.                 Telephone: +61-3-566-1023.
  28.  
  29. System Requirements
  30. ===================
  31. STUBS requires REXX to be properly installed on your system. 
  32.  
  33. About STUBS
  34. ===========
  35. Most developers have a pretty clear idea about how they like their
  36. source files organized. You may follow the more common conventions,
  37. or use a style of your own. Either way, you don't want to be typing
  38. all the same fluff for each new file created.
  39.  
  40. The most common solution to this problem is to keep a selection of
  41. templates. Rather than type a header, copyright info and so on - just
  42. copy the template and away you go. Two things could be improved though:
  43. you may end up with a clutter of templates, and the template may still
  44. need a bit of tweaking on a case-by-case basis.
  45.  
  46. STUBS.CMD allows you to automate your use of templates ("stubs").
  47. Running STUBS first presents you with a menu from which you can select
  48. the template to be generated. After providing a new filename, the
  49. script generates a file based on the selected template. Of course,
  50. being a REXX script it can include all kinds of smarts when generating
  51. the template - such as including a copyright notice with this years
  52. date (instead of the date from when you created the template;-).
  53.  
  54. So far its a good concept - but you may ask how I (as the guy who
  55. wrote STUBS.CMD) know how you want your templates produced. The answer
  56. is - I don't! In fact, STUBS.CMD comes as a basic menu shell but
  57. contains no actual templates. The one useful command it provides you
  58. (other than "exit") is "modify".
  59.  
  60. The "MODIFY" command allows you to add a new template to STUBS.CMD.
  61. You provide an example file, and the script reads it in, creating the
  62. necessary procedures and code modifications in STUBS.CMD to support
  63. the new template type. The code to write the new templates is
  64. encapsulated in procedures which are simply appended to the file.
  65.  
  66. When adding a new template, you are asked for three bits of
  67. information: the filename of the file to be used as the example
  68. template; the keyword to be used as the menu command; and a
  69. description of the template - this is used in the menu display.
  70.  
  71. How to best use STUBS? I suggest that you marshal your most commonly
  72. used templates and put a bit of effort into cleaning them up. Once
  73. they've checked out OK, use the MODIFY command to add them to STUBS.
  74.  
  75. By this stage, STUBS.CMD will be a self-contained script that can
  76. re-create your original templates on command. You can stop right
  77. there, however you may wish to delve in and customize the
  78. template-writing procedures to add extra capabilities (Such as
  79. date-stamping the files on creation).
  80.  
  81. For a more detailed discussion of the algorithms in STUBS, see
  82. the Electronic Developers Magazine for OS/2 Vol. 3 No. 3 (available
  83. on hobbes.nmsu.edu among other places).
  84.  
  85. Using STUBS
  86. ==========
  87. Getting help:     STUBS /?
  88. Usage:            STUBS
  89.