home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / blink_1 / !BLink_!Help next >
Encoding:
Text File  |  1997-04-05  |  8.5 KB  |  189 lines

  1.  
  2. About BLink
  3. ————————--—
  4. This utility is a "linker" for Basic files. It scans a Basic program for LIBRARY commands. Then it looks for any routines (PROCs or FNs) that are used in the main program, and defined in a library. These are then appended to the main program.
  5.  
  6. This enables you to develop your programs using procedures from one or more (large) libraries. When you have tested your program, you can use BLink for the final assembly. The libraries may contain procedures that you do not need in your current project — if they are not used, BLink will not include them. Thus, you get a minimal stand-alone program.
  7.  
  8. !BLink is a Wimp application, which is only a front-end for "blink", a command-line utility.
  9.  
  10. The program requires RiscOS version 3.10 or later.
  11.  
  12. BLink is FreeWare. For conditions of use, read the copyright notice at the end of this file.
  13.  
  14.  
  15. The desktop application
  16. -----------------------
  17. The program installs itself on the icon bar. To process a BASIC file, drag its icon from a Filer window to the icon bar icon. A "Save as:" box opens, allowing you to enter the leaf name of the resulting file. Then drag the icon from the box to a Filer window, or to an application (like !Edit).
  18.  
  19. (Note: the original file will be replaced by the result if you use the same leaf name and drag it to the same directory.)
  20.  
  21. The menu has, apart from the usual "Info" and "Quit", one entry: "Options" opens a window in which you can set the various crunching options (see below). The Options window is also opened when you click on the icon bar icon with Select.
  22.  
  23.  
  24. The command-line program
  25. ------------------------
  26. !BLink is a front-end to the command-line program "blink", residing inside this application. Command-line freaks can use it directly. The general command syntax is:
  27.  
  28.     blink [options] infile [outfile | -]
  29.  
  30. where <infile> is name of the main program, and <outfile> is the name under which the output must be stored. If no <outfile> is provided, then <infile> is overwritten with the output. If you type a "-" for the <outfile>, BLink will not create an output file. This may be useful if you only want to check that all used routines are indeed present.
  31.  
  32.  
  33. Options
  34. -------
  35. BLink has a number of options. The table below lists them, in their command-line form and in their !BLink equivalent. An explanation of their meaning is given further down in this file. 
  36.  
  37.   -b         React to Blib commands
  38.   -e         Look for EVAL'ed functions
  39.   -h         Print a help text about the command syntax (not for !BLink)
  40.   -l<files>  Include library files
  41.   -n         Print Basic's line numbers
  42.   -r         Include REMs before DEFinitions
  43.   -t         Throwback errors/warnings
  44.   -u         Report unused DEFs
  45.   -v         Report on prgress ("verbose")
  46.   -vv        Detailed progress report ("very verbose")
  47.  
  48.  
  49. The format of the input
  50. ———————————————————————
  51. When using BLink, the format of your program and libraries should follow these rules:
  52.  
  53. • The terminating "ENDPROC" (or "=<something>" for a FN) MUST be at the start
  54.   of a new line. Anything else will not be recognized by BLink. The reason for
  55.   this is that routines are sometimes "aborted", e.g. in case of errors:
  56.  
  57.     INPUT "Enter a number: " a%
  58.     IF a% = 0 THEN PRINT "Invalid input!" : ENDPROC
  59.     REM rest of processing ...
  60.  
  61.   This implies that you must be careful using libraries that have been treated
  62.   with a Basic cruncher: a cruncher usually concatenates lines, so the end of
  63.   a routine may not be on the start of a line anymore.
  64.  
  65. • You must not use any line numbers (GOTOs, GOSUBs etc.) in your program.
  66.  
  67. • Libraries may contain LIBRARY commands. These libraries will also be read.
  68.  
  69. • If a procedure is defined more than once, BLink will print a warning
  70.   message.
  71.  
  72.  
  73. The format of the output
  74. ————————————————————————
  75. • LIBRARY commands will be commented out by BLink. That is, after the
  76.   library has been scanned, "LIBRARY" is replaced with "REM{".
  77.  
  78. • The lines that are appended to the main program are renumbered; the
  79.   renumbering starts from the number of the last line of the main program,
  80.   with an increment of 1.
  81.  
  82. • Procedures in the main file are always included in the output, whether they
  83.   are used or not. If they are not used —— and the "-u" option is on —— then
  84.   BLink will print a warning message.
  85.  
  86.  
  87. -b = React to Blib commands
  88. ———————————————————————————
  89. This makes BLink look for commands in Blib style. ("Blib" is a system of Basic librares, written by Ian Palmer.) The Blib commands supported by BLink are:
  90.  
  91.   *|start
  92.   *|stop
  93.   *|ifdef, *|ifndef, *|else and *|endif
  94.   *|extract
  95.   *|!
  96.  
  97. The Blib commands are not included in the output. If you want the Blib comments (*|!) to be included, use the "-r" option.
  98.  
  99. Note: you can mix definitions in Blib style (*|start ... *|stop) with standard
  100. PROC/FN definitions.
  101.  
  102.  
  103. -e = Look for EVAL'ed functions
  104. ———————————————————————————————
  105. When checking which routines are used, BLink normally just scans for calls of PROCs and FNs. However, you can also use a FN by feeding it to EVAL, e.g.
  106.  
  107.   x = EVAL("FNsquareroot(PI)")
  108.  
  109. With the "-e" option, BLink will look for strings like "FN<something>", with an EVAL preceding it, If such a string is found, this will be taken as a call to that FN.
  110.  
  111.  
  112. -l = Include library files
  113. ——————————————————————————
  114. Basically, BLink gets the name of the libraries that it should scan from the LIBRARY command. The string that is given after "LIBRARY" is taken as a literal filename. This means that constructions that must be evaluated by Basic, such as
  115.  
  116.   LIBRARY MyDir$+".WimpLib"
  117.  
  118. won't work; BLink will print a warning message if it finds one. If your program uses this sort of thing, you must use the "-l" option to tell BLink the name of the library.
  119.  
  120. If there is more than one library of this kind, you can use this option several times on the command line. However, the maximum number of command-line options is 10. If you have a large nuber of small libraries, it is better to put them in a single "-l" option, with commas to separate the file names. For example, instead of
  121.  
  122.   -l<My$Dir>.WimpLib -l<My$Dir>.FileLib -l<My$Dir>.DateLib
  123.  
  124. you can write
  125.  
  126.   -l<My$Dir>.WimpLib,<My$Dir>.FileLib,<My$Dir>.DateLib
  127.  
  128.  
  129. -n = Print Basic's line numbers
  130. ———————————————————————————————
  131. Error messages are printed with the number of the line on which they occur. By default, BLink prints the text-line number. If you want to get the Basic line number, use this option.
  132.  
  133.  
  134. -r = Include REMs before DEFinitions
  135. ————————————————————————————————————
  136. Sometimes, there are REM lines preceding a definition, describing what the routine does, e.g.:
  137.  
  138.   REM Register as a Wimp task
  139.   REM taskname$ = name in Task Manager display
  140.   REM function result: task handle
  141.   REM 
  142.   DEF FNwimp_initialise(taskname$)
  143.   ...
  144.  
  145. With the "-r" option these REMs are included in the output. The lines are only included if there are no other lines between the last REM line and the DEF that follows.
  146.  
  147. In combination with the "-b" option (see above), the "-r" option has a different meaning.
  148.  
  149.  
  150. -t = Throwback errors/warnings
  151. ——————————————————————————————
  152. With this option, BLink will generate a throwback message for each error.
  153.  
  154. N.B.1: For users of the command-line version: throwback only works if you are running blink in a TaskWindow, or from the *-prompt (via F12).
  155.  
  156. N.B.2: If you are using !Zap, you should also set the "-n" option on to get the
  157. correct line number in the throwback. For users of !StrongEd, the "-n" option should be off.
  158.  
  159.  
  160. -u = Report unused DEFs
  161. ———————————————————————
  162. Routines in the main program are always included, even if they are not used. With the "-u" option, BLink will check if the main program contains any such routines, and print a message for each routine that it finds.
  163.  
  164.  
  165. Version history
  166. ———————————————
  167. 1.00  First released version
  168. 1.10  Additions:
  169.         * prints file names and line numbers with reported errors
  170.         * -l options can take list of libnames (instead of single name)
  171.         * -b, -e, -n, -t, -u and -vv options
  172.         * output can be inhibited with "-" as output name
  173. 1.11  Fixed bug that garbled *|Start and *|Stop Blib-commands when found
  174.       in main program
  175. 1.20  Added front-end application      
  176.       
  177.  
  178. Copyright notice
  179. ————————————————
  180. This program is FreeWare. This means that I retain the copyright. You may freely copy and distribute it, provided that it is complete with all original files, and that you do not sell it. PD libraries may charge a nominal fee for the cost of duplication, postage etc. When you use the program, you do so entirely at your own risk.
  181.  
  182. Dick Alstein
  183. Lijnslagerstraat 204
  184. 5625 BP  Eindhoven
  185. The Netherlands
  186.  
  187. e-mail: wsinda@win.tue.nl (old address, but still works)
  188.         dal@dasc.nl       (new address)
  189.