!BASCalc 1.06 (17th Apr 2008)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

BASCalc is a simple BASIC expression evaluator. It relies on the EVAL
statement in BASIC, which is very flexible and should allow most arithmetical
expressions to work.

It was inspired by a program called !Calcula, originally written by Iain
Logan back in 1992. Thus, I have also implemented some memories (M1 to M6)
and Hex, Decimal and Binary conversions. It also understands the variable X
which is the result of the last calculation.

Instructions
~~~~~~~~~~~~
To save a result into a memory location, type Mx=53+15 or mx=X where x is a
number from 1 to 6.

You can also perform simple number base conversions between binary, decimal
and hexadecimal. The following table gives some examples:-


                        Argument       Result
Binary to Decimal      %10110100        180
Decimal to Binary        BIN 34       =%100010
Hex to Decimal            &72           114
Decimal to Hex            ~55          =&37


If you enter a string of numbers separated by commas BASCalc will calculate
the arithmetic mean of the sequence. eg.

                1,10,23,12,6,8          10
                
You can set the number of decimals places that the answer is displayed to,
by selecting the relevant value from the 'Decimals' sub-menu.

                
Statistics
~~~~~~~~~~
If you prefix a string of comma separated numbers with SDEV you can perform
a standard devation on the sample, eg.

              SDEV 1,10,23,12,6,8       7.402702209

By prefixing with PDEV you can do a population standard deviation;

              PDEV 1,10,23,12,6,8       6.757711645

BASCalc uses the standard formula for calculating standard deviations, which is the amount by which a series of values deviate from the mean.
This is calculated by summing the squares of all the values, then dividing by
n-1 and square-rooting the result (where n is the number of values in the
sample).
The reason for specifying (n-1) and not n in the denominator is due to the
fact that there are only (n-1) independent pieces of information besides the
mean. For great values of n, it is usually of no significance whether n or 
(n-1) is used.

The population standard deviation will use n rather than (n-1).


VAT Calculations
~~~~~~~~~~~~~~~~
You can also perform VAT calculations (the actual rate is set within the
!BASCalc.Messages file), either adding VAT onto an amount or finding the
ex-VAT price of something. An additional entry in the messages file sets
whether or not to round to the nearest pence!
Use the keyword VAT+ to add VAT onto a value, or VAT- to find the ex-VAT
price. eg. I have now put in VAT calculations at 17.5%. These can be entered
in two ways, depending on whether VAT has to be added, or extracted from an
amount: eg.

                        Result
VAT+63.34               74.42      (ie. 63.34 +VAT)
VAT-799                 680        (ie. 680 +VAT = 799)

You can display ascii characters by entering CHR followed by a number,eg.
N.B. VDU works too!

CHR65                   "A"


Notes & Advanced Use:
~~~~~~~~~~~~~~~~~~~~~
You can leave spaces in the entry because all spaces are stripped out when
parsing the expression. Also, the expression is converted to upper case so
entries are case-insensitive.

You should be able to combine several operations but don't push it too much
as I haven't given it a very intelligent parser. For example, you should be
able to do things like the following;

    Argument            Result      (Notes)
    VDU%1010110         "V"         Output ascii of binary input
    &18+%1010           34          hex 18 (24) plus binary 1010 (10)
    VAT+&100            300.8       Add VAT onto hex 100 (256)
    CHR&30              "0"         Ascii of &30 (48)

BASCalc is designed to be a quick and easy way of doing simple calculations
and as such the parser is not extensively error checked. It is sometimes
quite possible to confuse if you enter a complex expression.
I therefore disclaim myself from all crucial calculation errors! :-)

Hopefully, all potentially fatal errors will be trapped and either an error
message or 0 will be displayed in the result icon.

If you have any comments/suggestions/ideas for improvements etc please feel
free to contact me. I can't guarantee to implement anything specific but I'll
certainly look into it.
No comments about the tidiness of my code please!!! ;-)

Colour/GCOL Conversion
~~~~~~~~~~~~~~~~~~~~~~
Sometimes programmers may wish to convert from !Paint 256 colour numbers into
the equivalent GCOL and TINT values.
You can carry out this conversion by using the PAINT command followed by the
colour number, as given by !Paint's 'show colours' display in 256 colour modes.
eg.

	PAINT 64 gives GCOL 8 TINT 0
	PAINT 150 gives GCOL 19 TINT 128
	

Copyright Message
~~~~~~~~~~~~~~~~~
This application and all its associated files are the copyright of the
author; Paul Vigay but you are free to pass it around as long as all files
remain intact an unaltered and the whole application is distributed
(including this !Help file).

This software is public domain and the source code in BASIC is supplied.
However, if you do make any alterations, or would like new features added,
please contact me so that I can keep the most up to date version on my web
site.


Contacting me
~~~~~~~~~~~~~
I can be contacted via the following methods;

Email:	nospam@vigay.com
  Web:  http://www.vigay.com/software/
 Post:  104 Manners Road, Southsea, Hampshire, PO4 0BG, England


Version History
~~~~~~~~~~~~~~~
 v1.06  (17th Apr 2008)
       a) Added 'PAINT' command (to convert into GCOL values).
       b) Added web and mail links to 'Info' window.
       
 v1.05  (6th Mar 2006)
       a) Added 'All Clear' (AC) button to clear entry box as well as all memories.
       b) Added a small button for pasting the answer at the caret position.
       c) Added 'Decimal places' menu option, to set the number of decimals for results.
       
 v1.03  (25th Jan 2006)
       a) Changed labels from 'C' to 'Clear' for clarity.
       b) Caret position correctly reset when 'Clear' clicked upon.
       c) Made window toggle open and closed on clicking on iconbar.
       d) Centred window positioning above iconbar.
       e) Added some additional information on standard deviations.
       
 v1.02  (23rd Mar 2005)
       - Amended VAT calculations to fix a bug in calculating ex.vat prices.
       
 v1.01  (16th Jul 1999)
       - Amended parser so that characters inside quotes are not converted
         to uppercase. This should fix calculating ASC"a" etc.
         
 v1.00  (11th Jun 1999)
       - First release version - should work ok.
   
   
1999 Paul Vigay
