home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / RiscOS / APP / DEVS / BASIC / BACNST.ZIP / !BASICcnst / !Help < prev    next >
Text File  |  1995-05-29  |  5KB  |  120 lines

  1. !BASICcnst
  2. v 1.05 (29-May-1995)
  3.  
  4. This program is Shareware.
  5. This means that you can copy this program to anyone you like, but if you
  6. find the program useful, you should register, as explained below. This
  7. entitles you to the latest version of this program, and of all my other
  8. applications.
  9. If you do copy the program it should be in its original format, with ALL of
  10. the accompanying files. That is : !Boot
  11.                                   !Help
  12.                                   !Run
  13.                                   !RunImage
  14.                                   !Sprites
  15.                                   !Sprites22
  16.                                   Code
  17.                                   MakeCode
  18.                                   Messages
  19.                                   Sprites
  20.                                   Templates
  21.  
  22.  
  23. Purpose
  24. -------
  25. Provide a 'constants' function for BASIC. It allows BASIC programs to be
  26. written with easy readablity, and the final version can have the speed of
  27. numbers rather than variables in the code.
  28.  
  29. To use
  30. ------
  31.    Write your BASIC program as normal, except for these rules :
  32.       1) The first line should be REM BASIC constants
  33.       2) After this line, assign a list of variables which function as constants
  34.          eg. init=&4B534154
  35.       3) After the list of variables, the next line should be REM End constants
  36.    NB. The lines for steps 1 and 3 *ARE* case-sensitive.
  37.    Then save the BASIC program. Double click on the !BASICcnst in the filer
  38. window to install an icon on the icon bar. Drag the saved BASIC program's
  39. icon from the filer window onto !BASICcnst on the icon bar. This will open a
  40. window offering the choice of where to save the processed file. The output
  41. file can be the same as input (although I would advise against it, unless you
  42. have a backup!) The window works in the same manner as any normal RISC-OS
  43. save dialogue box, but displays the input file for reference. After telling
  44. it where to save the output, the program will then process the BASIC program,
  45. converting all the constants into their actual values, and then removing the
  46. constants declaration.
  47.    Constants can be reals, integers or strings.
  48. For example, the BASIC program:
  49.    10 REM BASIC constants
  50.    20 riscver=200:init%=&4B534154:progname$="My Program"
  51.    30 REM End constants
  52.    40 SYS "Wimp_Initialise",riscver,init%,progname$
  53.  
  54. would become
  55.    40 SYS "Wimp_Initialise",200,&4B534154,"My Program"
  56.  
  57.    Beware of having a variable array with the same referencing name as a
  58. constant, as this will (probably ;-) cause some problems. e.g if you have an
  59. array constantname() it will probably be changed to constantval(). I've tried
  60. to stop this happening, but I can't offer any guarantees as yet. 
  61.  
  62. Note that the program does not do any renumbering - it merely deletes the
  63. first lines up to and including NN REM End constants. This allows for GOTOs
  64. (bleugh) and the such, without the need to write lots of checks into the
  65. program. (Hence slowing it down, as if it wasn't slow enough already!)
  66.  
  67. Note also that at present you are 'limited' to 5000 constants. I put limited in
  68. quotes, as I can't see a situation where somebody should want more, unless they
  69. are naming the first 5002 integers, that is. ;-)
  70.  
  71.    NB. This version is not very friendly with expressions using constants.
  72. For example, the line
  73.       PRINT constant+5
  74. would be replaced by (assuming constant=23)
  75.       PRINT 23+5
  76. when PRINT 28 would be much more efficient. This will be rectified in later
  77. versions. (Unless I write a separate application to do that and more...)
  78.  
  79.    Clicking menu on the icon on the icon bar will open a menu offering the
  80. normal Info and Quit options.
  81.  
  82.    Finally, the program counts its errors and their time intervals. If it has
  83. to report five errors, each one being within two seconds of the previous one,
  84. then the program will kill itself. This solves (hopefully!) the problems of
  85. an unbreakable error loop.
  86.  
  87.  
  88. Bugs & Improvements
  89. -------------------
  90. Please report any bugs found and any possible improvements you can think of
  91. to me at the address shown below.
  92.  
  93.  
  94. Registering
  95. -----------
  96. To register, send ú5 to me, at the address shown below, stating what version
  97. of which of my programs you have. You can enclose your own disk for the
  98. programs, and if you do so you can deduct 50p from the price. Registering
  99. entitles you to upgrade to later versions of the same programs and to get new
  100. programs for the price of ú1. Any additional contributions from overseas
  101. towards postage would be greatly appreciated.
  102.  
  103.  
  104. Neil Walker.
  105. 16, Finderne Drive.
  106. Wymondham.
  107. Norfolk.
  108. NR18 0HU.
  109.  
  110.  
  111. Legal Notice
  112. ------------
  113. This program is supplied 'as is'. I therefore cannot be held responsible
  114. for any loss of data, profits or any other loss, either directly or
  115. indirectly, that may be incurred by the use (or misuse) of this software,
  116. even if I am aware of the possibility of such a loss. However, I can assure
  117. you that in its original state, the program contains no deliberate viruses,
  118. or damaging procedures, except where these are necessary for the fulfilment
  119. of the program's function.
  120.