UCalc Fast Math Parser BETA release K, August 2004.
 Copyright 1998-2004 by Daniel Corbier.
All rights reserved.

August 2004

Support for multi-threading is finally restored.

The temporary slowdown of the previous betas was removed.  Now
this beta is much faster than ever.  Check out the new Turbo
mode in the Demo program.  Also, if you want to do integer-only
calculations, try ucEvaluateLng.

The help file Contents Table was re-done.  A helpful Summary of
Routines topic was also added.  Overall the help file was revised
for better clarity and relevance.

Support for operator macros was added.

Data type implementation was greatly refined.

Overall, everything was tightened some more.


May 2004

Support for Visual Basic .NET (under VS.NET 2003) was added to
this beta.  UCalc under VB.NET will work nearly the same way as
under VB 6, though there are some minor inconveniences that still
need to be worked out.

With this beta the help file is now nearly completed, down to
the examples for various compilers, which have been written
up and tested, to many details that are likely now in their
final form.  Though the help file is nearly complete, there
are still some unfinished topics.

Things are also tightening up in the DLL detail by detail to
make sure everything works as documented.  This beta is more
stable than the previous one as a result.  But there's still
some more work left.


February 2004

On the surface you will not notice much change.  However,
beneath the surface, a great deal of restructuring was done.
The new structure is more flexible, and more organized, as
well as more intuitive, and more efficient.  Things are
also tightening up so that more features work correctly,
though there is still some work left in that respect.

Though multithreading was one of the first new features to
be added, it likely does not work correctly in this beta.

Also, this beta may seem much slower than previous betas.
It's a temporary condition.

The help file is a lot closer to completion.

VB no longer uses a registered COM DLL as in the previous beta.


August 2003

This August beta ends the construction phase.  Though
it's not impossible for a new feature or two to slip in,
for now work is geared mainly on refining the features that
are currently present, until it is stable enough for release.

The major new feature in this beta is multi-line parsing,
which is ideal for scripting.  The documentation may be
scarce on this topic.  For now, see the Test.Bas file
(search the code for "ucMultiLine").  That particular file
compiles only in PowerBASIC, but the code can be adapted
to other compilers.

New features are explained in the help file (UCALCDLL.HLP).  Not
everything described in the help file is implemented yet.  It
has also not been spell-checked.  Items within double brackets
[[like this]] or "+++" are reminders to myself, and can be ignored.
The VB examples in the help file are the most accurate ones.  The
Delphi and C++ examples need to be revised.  The source code in the
demo programs (Demo*.*) are more authoritative than the code in the
help file.  You may occasionally notice some contradiction in the
help file at this stage, as things are constantly changing.

Included in this beta (maybe) is the source code for for the
add-on libraries.

Distribution Restriction:  This beta is available only at www.ucalc.com.
Redistribution through any other site or media is not allowed.

New for Beta H, August 2003
* Major new feature: Multiline scripting

New for Beta G, June 2003
* Unary operators can be defined
* ucTreeParseUp now supported.  Test.Bas file includes simple symbolic
  calculation demonstrations using this.
* See UCALCDLL.HLP for more

New for Beta F, March 2003
* See UCALCDLL.HLP



The text from previous betas is preserved in this .TXT file.

DISCLAIMER
The following disclaimers are in addition to the ones in the help file:

- There is no guaranty as to the date of release for the next version.
- There is no guaranty as to the features of the next version.
- There is no guaranty as to the suitability of this version for
  purposes other than beta testing.
- All parts of the beta version are subject to change without notice,
  and without regard to compatibility from one beta version to the next.
- A license for the beta cannot be purchased.  Until the next version is
  no longer in beta, only a license for version 2.0 can be purchased.

This beta version is not suitable for use in a real project.  It
is intended for testing purposes only, in order to uncover bugs
and design flaws.  For a finished product, please go online at
www.ucalc.com/mathparser and download version 2.0 instead.






NEW for February, 2002 beta
* See UCALCDLL.HLP



--> The following is OLD information, please use the help file instead

NEW for June, 2001 beta
* Built-in string comparison operators (<, >, <>, >=, <=, =).
* Hundreds of add-on functions (Stats, Financial, Date, String, etc...) in separate DLLS
* Functions and operators can be overloaded.
* Operator symbols (not just names) can be defined.
* Callback error handling (See sample program).
* Several speed bottlenecks in ucParse removed.
* Arrays are directly supported.
* Enhanced Tree Preparse.
* The DLL is renamed to UCALCFMP.DLL to avoid conflict with previous DLL
* Several built-in functions, LBOUND, UBOUND, VARPTR, etc...

Temporary changes to note:
* ucReset is different.  You may change it in the class initialization, but do not call it directly.
* The ucPreParse function option is temporarily disabled. Use the more powerful ucPreParseTree.

NEW for 1/31/01 beta
Include files for Delphi and C++
Updated examples for VB, Delphi and C++
The DLL is a lot more stable than the previous beta
Detailed tree pre-parsing - see ucPreParse "@" in the sample program

New for 12/15/00 beta
1. Multi-threading / COM / ActiveX support.
2. Variables are directly accessed. ucVariableValue is no longer needed.
3. The conflict between AND, & and + has been resolved.
4. Operators can be assigned their own precedence level.
5. You can alias operators.
6. ucUnAlias has been added.
7. The IIF function is improved.
8. Implicit multiplication can be turned off
9. ucErrorClear has been added.
10. IsVariable was added
11. Randomize was added

Here is a more detailed description of the above features:

1. Multithreading.  This has been a very popular request.  So it was one of
the first things I worked on.  The parser was internally redesigned for thread-
safety, and an ActiveX DLL wrapper (named ucalcx.dll) for it was created.
You will need to register this file with the windows REGSVR32.EXE program,
and then you can access it from your compiler's Reference list.  If you don't
want to use that DLL, you can simply include the UCALCX.CLS class in your
project, along with the UCALCVB.BAS file.  For now, I have only had a chance
to work on connecting it with VB.  Until another beta, non-VB users can
look at the VB files to see how the wrapper class was implemented.  Or
you can access the ucalcx.dll, but you would need to keep in mind the
different string type you should use.

In general, the syntax for most items is similar to version 2.0.  However,
there are some key important changes.  When you define your callback functions,
you must pass it a Long Integer argument, ucThread.  And you must change
occurrences of ucParamCount and ucSetError to ucParamCount(ucThread) and
ucSetError(ucThread).  ucParam and ucErrorData must now include a second
argument, which is ucThread.  This is what allows the parser to return the
arguments of the appropriate thread to your callback function.

So you would change a callback function such as:

-----
Function ucalcAverage() As Double
     Dim x As Long, Total As Double

     For x = 1 To ucParamCount
          Total = Total + ucParam(x)
     Next

     ucalcAverage = Total / ucParamCount
End Function
-----


To the thread-safe version, which is:

-----
Function ucalcAverage(ByVal ucThread As Long) As Double
     Dim x As Long, Total As Double

     For x = 1 To ucParamCount(ucThread)
          Total = Total + ucParam(x, ucThread)
     Next

     ucalcAverage = Total / ucParamCount(ucThread)
End Function
-----


IMPORTANT:
There is one thread that is designed to behave differently than the others.
The first thread is global.  All functions/variables/settings defined in
this base thread are also available to all other threads (but not vice-versa).
This allows you to load key functions only one time, instead of having to do
it in each thread.  This saves time and memory.  The base thread should
therefore only be used prior to any multithreading activity.  Nothing should
be changed in the base thread when other threads are active.


2. Now, you can define and use your variables as follows:

Dim x as Double, y as Double

ucDefineVariable "x", x
ucDefineVariable "y", y
x = 10
y = 50

Answer = ucEval("2*x + y")

This will give you 70.  The intermediate ucVariableValue step is no longer
necessary.  The second argument in ucDefineVariable is passed by referrence.
The address of your variable is passed to the parser so that it can work
directly with your variables.

There is good news and bad news about this feature.  The good news is
that it's easier to program, and it has less overhead.  Your program
should run faster without the extra overhead.  In addition to that,
by working directly with the variable's address, the ucEvaluate function
itself would also run faster.  Unfortunately, that would only be true
for compilers which support extended precision, such as Delphi,
Borland C++ Builder, and PowerBASIC (although in this beta, it hasn't
been optimized yet).  Unfortunately, this very thing can make it run a
little slower for compilers which do not support better than Double
precision.  It must pass through a conversion step from Extended to Double
for each variable in the expression, in order for it to work.  This makes
it potentially slower than using ucSetVariableValue.  I haven't figured
out a clever way around this yet.  If you have suggestions, please let
me know.


3. There was a conflict between the "AND", "&" and "+" operators.  In
version 2.0, the distinction between those arguments was ambiguous.
The "&" and "+" operators are synonymous for string concatenation, while
the "&" and "AND" operators are synonymous for numeric operations.  This
presented a roadblock if you attempted to define string comparison
operators, especially for expressions containing the "AND" operator.
This problem has been resolved.

4. In working on the above problem, I made it possible for users to
define operators with a specified precedence level (instead of having
the same level for all user-defined operators).  This flexibility
for instance would have allowed the user to go around the above problem.
This may come in handy in an as-of-yet unforeseen way.

5. Operators can be aliased.  This can simplify the task of defining
operators which share the names of predefined operators.

6. You can remove an alias with ucUnAlias.

7. The IIF function has been improved so that only one conditional
branch is evaluated.  In version 2.0, the parser evaluated all arguments,
and discarded the one that wasn't needed.  This presented a problem
for those of you who didn't want it to evaluate the other argument
which for instance might be a division by 0, thus invalidating the
whole calculation.

At the same time, it is now possible to define functions in such a way
that only the relevant arguments are actually parsed, thus making
them potentially faster.  The built-in IIF function for instance would
look like this in VB code:

ucDefineFunction "IIf(condition,true&,false&)", AddressOf IIF

Function IIf(ByVal ucThread As Long) As Double
  Dim TruePart As Double, FalsePart As Double

  TruePart = ucParam(2, ucThread)
  FalsePart = ucParam(3, ucThread)
  If ucParam(1, ucThread) Then IIF = ucEvaluate(TruePart) _
                          Else IIF = ucEvaluate(FalsePart)
  ucSetError(ucThread) = ucError(ucThread)
End Function

8. Implicit multiplication apparently got in the way of what some
people wanted to do.  Now this option can be toggled off, with
ucReset("Implicit=Off").

9. In version 2.0 when an error was returned in ucError, the error
value was reset only the next time you parsed an expression (or called
a function such as ucEval).  However, the error value remained if
you were only calling ucEvaluate.  Now you can clear the error value by
simply calling ucErrorClear.

10. Some will benefit from the ucIsVariable function which tells you
if the item is a variable, instead of using ucParse with all of the
overhead.  This function was already there internally, now it's exported
for your use as well.

11. Now you can change the random seed with ucReset("RANDOMIZE=value")
This way you can work with a specific random sequence each time, or you
can change it etc...
