    _               ____  ____            
   / \   _ __  _ __|___ \| __ )  __ _ ___ 
  / _ \ | '_ \| '_ \ __) |  _ \ / _` / __|
 / ___ \| |_) | |_) / __/| |_) | (_| \__ \
/_/   \_\ .__/| .__/_____|____/ \__,_|___/
        |_|   |_|                         
==========================================
v1.18 (18 Nov 2014) by James Lampard (resurgam.riscos@gmail.com)
A re-write of !BasicGrab for 32bit/RO6 compatibility.

This program allows you to extract a Basic program, from an Absolute code
wrapper.
To use run !App2Bas, drag an absolute file to the icon bar and press RUN.
If the file is suitable, you will get a save box for the Basic, if not 
you'll most likely get an error message or the absolute will be run!

The only problem I've had during testing, is that for some large progams 
I've needed to increase the 'Next' wimpslot in the task manager.

CLI use:
App2Bas can also be run directly via the CLI. You will however need to use
a taskwindow and not ShellCLI (which is what you get after pressing F12)

The command is *App2Bas
and it's parameters are
[-INFILE] <afsp>       the input absolute file
[-OUTFILE] <fsp>       the output basic file
[[-TIMEOUT] <seconds>] length of time, after which app2bas will give up
                       (this defaults to 15 seconds)
                       If you turn the cache off to run an old/recalcitrant 
                       you may need to set a longer timeout.


History
v0.05 (09 Jul 2006)
  Added HackMod to cope with programs that use %Basic, so now works
with KeyWindow & programs produced by WimpWorks2.

From my investigation of WimpWorks2, it turns out the second parameter of 
BASIC @xxxxxxxx,yyyyyyyy doesn't have to point exactly 1 Byte beyond the
end of the program. It can (and in the case of WimpWorks2 does) point higher
in memory.

To avoid "Warning, Appended data truncated" messages from Zap;
we now scan the BASIC program for the end, rather than dumbly trusting
the BASIC command.

v1.00 (01 Sep 2006)
  First official release version, now finds and removes 'cli preserving
first line' (if present).

v1.05 (18 Sep 2006)
  Fixed window position, added help meta tokens, documented cli use. Increased
slot-size so works on Wimpory.

v1.11 (17 Jan 2007)
  Now works with Slayer's RunImage, which rather naughtily does a *unset
alias$basic which messes things up mightily for me.
Also now App2Bas is re-written as a Basic program, rather that several aliases
and an obey file; this should provide greater resistance to errors.

v1.12 (19 Feb 2007)
  Updated to use ResFind, for international friendliness.  The utility 'REMCLIL'
was re-tokenising read lines, this caused problems with output from StrongBS2
(which puts any binary value into strings). This is now fixed, so works with
Wimpory again.

v1.14 (07 Nov 2007)
  Linked with updated libraries, so it will now work with RISC OS 6.06

v1.15 (14 Jun 2008)
  Minor tweaks to work with RiscPkg.

v1.16 (30 May 2009)
  To be able to grab Coconizer, App2Bas has been changed to sit on OS_FSControl 
2, this is much simpler than the old system of aliasing *BASIC (which had to
cope with some programs calling %Basic, and some unsetting Alias$Basic)
Added timeout parameter.

v1.17 (20 Jul 2014)
  Updated to use ResFind 3.00
  Minor build system tweaks  
  
v1.18 (18 Nov 2014)
  Updated email addresses
  Transient utility updated to include "32OK" signature
  Improved RiscPkg control file
  Improved memory management: The previous versions would add the memory
requirement onto the existing wimpslot. So if you start with a wimslot of 640k
it would add memory for all the basic libraries and the heap making the slot 
688k. When the program ends the wimpslot stays at 688k.
If you run it again it will start with a wimpslot of 688k...
This is a noticeable problem if you were to run App2Bas repeatedly in a task
 window - it accumulates memory.
  The new version reduces the slot down to the minimum required and returns the
slot to the original size when the program ends.
  More improved memory management: The aliases for App2Bas and REMCLIL now
set a sensible wimpslot - so they will at least run. (Although the slot may
not be enough for the basic program we want to convert.)
  

Copyright & Warranty:
App2Bas and its associated files are freeware (c) James Lampard 2006,
it may be distributed only if no files are altered.
This software comes with no warranty, and the author cannot be held
responsible for any damage caused by use or misuse of this program.
