home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 126-150 / scopedisk138 / basicpreprocessor / bpp.doc < prev    next >
Encoding:
Text File  |  1995-03-19  |  3.7 KB  |  112 lines

  1. Bpp - Basic Pre-processor
  2. © 1990 by Steven D. Kapplin
  3. CIS 70055,1021
  4.  
  5. Bpp is a simple pre-processor which reads in a Basic source program,
  6. identifies the subroutines and functions, then searches a second
  7. library file and extracts the subroutines and functions.  It then
  8. either appends them to the source program or writes them out to a
  9. separate file for use as an INCLUDE file.
  10.  
  11. Bpp is written in HiSoft Basic.  The source and executable are
  12. included in this archive.  Bpp runs only from the CLI.  The
  13. syntax is:
  14.  
  15.     Bpp PgmFile LibFile [OutFile]
  16.  
  17. The last parameter, OutFile, is optional.  If a "?" is used in
  18. place of PgmFile or if the command line is blank, then Bpp will
  19. provide a simple syntax help message.
  20.  
  21. In order to make Bpp as efficient and simple as possible, your
  22. Basic source files should follow this format:
  23.  
  24. The beginning of your source file should contain a REM statement
  25. followed by the keyword EXTERNAL.  The next several lines will
  26. contain REM statements followed by the names of the subroutines
  27. or functions you want appended to the source file.  Each
  28. subroutine or function should be preceeded by its corresponding
  29. keyword, FUNCTION or SUB.  The last line will contain a REM
  30. statement followed by the keyword ENDEXTERNAL.  Following is an
  31. example:
  32.  
  33.     REM My Basic Program
  34.     REM
  35.     REM EXTERNAL
  36.     REM FUNCTION func1
  37.     REM SUB sub1
  38.     REM SUB sub2
  39.     REM FUNCTION func2
  40.     REM ENDEXTERNAL
  41.     REM
  42.     .
  43.     .
  44.     .
  45.     .  program source
  46.     .
  47.     .
  48.     .
  49.     .
  50.  
  51. Although this may seem somewhat confining, given Basic's rather
  52. freeform programming style, it makes searching for SUBs and
  53. FUNCTIONs much easier.  Note that Bpp will not recognize the DEF
  54. FNfuncname, END DEF form of defining a function.  To make things
  55. easier, I have made it necessary to use the FUNCTION, END
  56. FUNCTION form of defining a function.  Because either form is
  57. acceptable in HiSoft, this shouldn't create too many problems.
  58.  
  59. Your library must also follow certain conventions for Bpp.  The library
  60. should be structured as follows:
  61.  
  62. REM sub1 or function1 name
  63. SUB subname1(parm1,parm2,...)
  64.     .
  65.     .
  66.     . source code
  67.     .
  68.     .
  69. END SUB
  70.  
  71. REM sub2 or function 2 name
  72. FUNCTION funcname1(parm,parm,...)
  73.     .
  74.     .
  75.     . source code
  76.     .
  77.     .
  78. END FUNCTION
  79.  
  80. The keywords FUNCTION and END FUNCTION may be used in place of
  81. SUB and END SUB if you want to define a FUNCTION.  Your library
  82. should have NO REMs other than one that immediately preceeds EACH
  83. function or subroutine definition.  If you need remarks use the
  84. "'" instead of REM.  The REM is followed only by the name.  Do
  85. not use any "()".
  86.  
  87. You will also note that Bpp is written primarily to support
  88. HiSoft Basic rather than AmigaBasic.  Although this will work
  89. with AmigaBasic, you can only use subroutines because AmigaBasic
  90. does not support the FUNCTION, END FUNCTION keywords.
  91.  
  92. Bpp will check the command line and will provide appropriate
  93. error messages is files are not found or parameters not
  94. specified.
  95.  
  96. Bpp makes possible the compilation of one library file containing
  97. all your favorite subroutines and functions.  By listing the
  98. needed ones in your program using the format specified above, you
  99. can then "link" the needed routines into your main source program
  100. or create a separate INCLUDE file.  This makes using HiSoft Basic
  101. a little more like a true compiler system.
  102.  
  103. If you make any modifications to this program, please be sure to
  104. post your contribution on CompuServe's AmigaTech SIG for the rest
  105. of us to enjoy.  Feel free to add your Copyright to mine as I lay
  106. claim only to this initial contribution.  If you make changes or
  107. additions, take credit for them, but please don't delete mine.  I
  108. make no claims regarding the usefulness of this program nor do I
  109. make any guarantees that it will run flawlessly.  If it damages
  110. your system, files, etc., I am not responsible.  Use at your own
  111. risk.
  112.