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