home *** CD-ROM | disk | FTP | other *** search
/ ISV Strong Games / ISV_STRONG_GAMES.iso / adventure / overcast / !JFShared / Skeleton / Squashed / !Help next >
Text File  |  1997-01-31  |  3KB  |  62 lines

  1.                 Using BasCompress with JFShared applications
  2.                 ============================================
  3. Rationale
  4. ---------
  5. I dislike people who release /just/ BasCompress'd code. The reason for this
  6. is quite simple. When I learnt to write Wimp Applications it was a 'fun'
  7. thing because I learnt from other people's code and from scouring the OSLib
  8. header files. This has, I hope, given WimpLib a feel of some other
  9. applications but still retained it's own qualities. Recently however, a large
  10. number of people have complained at the use of JFShared and said they would
  11. prefer totally BasCompress'd applications as they don't need to get hold of
  12. JFShared then. I counter that JFShared is a /shared/ resource and
  13. distributing it seperately means I save on my web quota (currently exceeded
  14. :-( ) and I can distribute application in 4k Zip files instead of 20k.
  15.  
  16. However, there are times when it is preferable to compress your code. These
  17. include times when you've used a lot of constants with long names or the
  18. program is just taking up too much memory when running. Under these
  19. circumstances I would urge you to compress your Basic code using BasCompress
  20. (which only rarely fails in my experience) but *also* to include the
  21. uncompressed source.
  22.  
  23. This, obviously, isn't a requirement, but if I learnt this way (and I know
  24. quite a number of better programmers than me also did) then so might others.
  25. Please bear this in mind next time you reach over for those expensive PRMs.
  26.  
  27. Usage
  28. -----
  29. What I suggest you do is this :
  30.   a) Call your uncompressed file !RunImageU ('U' for uncompressed) in the
  31.      application.
  32.   b) Copy in the Compress (or CompressVF if you're pretty sure nothing bad
  33.      will happen with EVAL's) into your application.
  34.   c) If you've used HeapLibrary, include the line :
  35.        LIBRARY "<HeapLibrary$File>"
  36.      /before/ the LIBRARY "<BasicLibrary$File>". This is because otherwise
  37.      BasCompress will ignore the HeapLibrary routines and only use the RMA
  38.      versions in WimpLib. By including the file twice, once before and once
  39.      after you will incur a slight extra memory usage when not compressed,
  40.      but ensure that both versions work. Refer to the BasCompress docs for
  41.      more details.
  42.   d) If you are using Special files to compress the file you will need to
  43.      modify the CompressVF file as it describes.
  44.   e) Run the Compress (or CompressVF) file. This should compress the
  45.      application (if you've seen BasCompress, otherwise it'll give an error)
  46.   f) Run the application and test that it works. Important things to check are
  47.      that it doesn't crash when you run !Help over it and that error messages
  48.      aren't titled 'Message from ¤Appname$¤'.
  49.   g) Go to the Info box and click on the program name icon. This should
  50.      display the statistics for memory usage.
  51.   h) Comment out the WimpSlot and Run lines from the Obey file and copy them
  52.      /below/ the originals (uncommented).
  53.   i) Change the -min and -max values so that they take up almost all the
  54.      'Free' space given by the Info box display. Remember to leave about 4k
  55.      free for loop structures, etc. This may also vary from program to
  56.      program.
  57.  
  58. Now, when you want to work on the uncompressed version you should uncomment
  59. the old lines and comment the new ones out, and vice versa.
  60.  
  61. You should release programs so that they run the compressed version.
  62.