home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
express.zip
/
README.TXT
< prev
next >
Wrap
Text File
|
1995-08-30
|
14KB
|
355 lines
=============================
Expression v1.3 Documentation
=============================
Thank you for trying Expression v1.3.
It's a demonstration program, to show the possiblities of
ExEngine v3.3 - the underlying code-module that handles variables
and expressions, generates P-code out of them and evaluates / executes
it - all at runtime.
Also it's a useful program to visualize numeric expressions to 2D-graphs.
With this release you receive identical versions of Expression for
Win16, Win32 and OS/2. It has not been tested for Windows 95.
Please let me know, if you expirience problems with Windows 95.
If you are interested in having ExEngine v3.3 read the section
named "ExEngine".
It's available as DLL you can use from nearly any programming-
lanuage for windows and OS/2, including C/C++, Basic and so on - also
available for other platforms or as source-code.
Please, also note the announcement of "VPEngine" The Virtual Print
Engine at the end of this manual.
==========
I. Preface
==========
Expression is an easy-to-use program which can be understood and
handled very fast. It's optimal for schools and schoolars, nothing
needs to be explained for very long.
This program is freeware. Give it to your friends, collegues and
anybody else who could be interested in it. You need not to register.
You must distribute this program unchanged and intact, all files have
to be shipped with it, also this "readme.txt".
Freeware/Shareware vendors may distribute the program freely provided
they contact me first and charge less than $5 for disks/shipping/etc.
and not for the program itself.
My address:
T. Radde CompuServe: 100 430, 34 27
Grefrather Weg 96
41464 Neuss Internet: 100430.3427.compuserve.com
Germany
================
II. Installation
================
EXPRESS.EXE is installed correctly, when it comes up showing
a black, a red and a blue graph. Otherwise check the working
directory.
Files in this archive:
----------------------
README.TXT -- this file
FEEDBACK.TXT -- feedback form (ASCII text)
EXPRESS.INI -- common ini-file for all platforms
DEFAULT.EXP -- contains no definitions
TRIGONOM.EXP -- demonstration definitions (sine & cosine)
ANALYSIS.EXP -- demonstration definitions (f(x), f'(x) and f"(x))
OS2/EXPRESS.EXE -- program file
WIN16/EXPRESS.EXE -- program file
WIN32/EXPRESS.EXE -- program file
Don't forget the "-d" parameter for pkunzip to extract the
subdirectories. ("pkunzip -d express.zip")
1. Create a directory on your hard drive - e.g. C:\express
[you can use a different directory or share an existing one if you
want]
2. Copy all of the files in this archive file into that directory (see
above for a complete list).
Windows:
3. Start up Windows if you weren't already using the File Manager to
perform the steps above.
4. Open the group in Program Manager you want to put Expression in.
Select "New..." from the "File" menu in Program Manager.
5. Select "Program Item" in the dialog box.
6. In the Description box, type "Expression".
7. Click the Browse... button and use the dialog box to navigate to
the directory Expression's files are in and select EXPRESS.EXE.
8. Set the working-directory to the same path where EXPRESS.EXE is
located.
9. Select "OK". Expression should now be installed. Double-
click on its icon to run it.
OS/2:
3. Open the template folder.
4. Move the "Program" template with the right mouse-button
onto the desktop.
5. Enter the location where EXPRESSION is.
6. Enter the program name "Expression".
=====================
III. Using Expression
=====================
Expression is very easy to understand.
The program is divided into two main parts:
1) Graph drawing (Menu: "Actions / Draw Graph")
2) Computing Expressions (Menu: "Actions / Expressions")
In both dialogs you can define expressions and other parameters.
All these definitions can be saved using the Menu: "File / Save" and
loaded using the Menu: "File / Open".
Note: The "save"-function also saves the current layout - i.e. the
positions and sizes of the windows.
But the last saved layout is always used for ALL definition files.
On startup Expression automatically loads the last saved definition
file.
The rest of the program is explaining itself.
-Just keep in mind, that changes only become valid, after you
pushed the "Insert"- or "Change"- or "Set"-button...
-Note the "y-range" button in the "Draw Graph" dialog, which
calculates for all drawn functions over the specified x-range the
maximum y-range, to make all graphs fit into the coordinate system.
-Also note, that you can enter real EXPRESSIONS in both, the x-unit
and the y-unit fields - you have two predefined variables:
"xr" and "yr", which means the value of "x-range" and the value of
"y-range".
This gives you the following advantage:
Imagine, you want to draw the sine-function over PI (=3.1415...). So
you enter 3.1415 in the x-range-field. If you want to have the x-units
drawn on PI/4 you would need to calculate these values.
Why? - We have got an expression-evaluator build in!
So just enter in the x-unit-field: "xr / 4"
That's all. - Look at the "trigonom.exp" - example definition.
===========================
IV. Description of ExEngine
===========================
In this version ExEngine is linked statically to EXPRESS.EXE, so you
won't find the DLL.
ExEngine (= Expression Engine) is the heart of Expression.
ExEngine is a DLL, which can be used from any programming
language that supports the DLL-calling conventions.
(like C/C++, Pascal, Basic, SQLWindows and so on)
It gives you the ability to define and modify variables and to use
them within your self-defined functions at runtime. Using it from
compiler-languages, such as C, you are additionally able to EXPORT
THE ADDRESSES OF VARIABLES AND FUNCTIONS (!!!) FROM
WITHIN YOUR CODE TO THE DLL, so that ExEngine can directly
access them. This provides you nearly unlimited possibilities.
Since ExEngine generates pseudo-code, computations are done
very fast. (All computations are done with the "double"-datatype -
this is not the best for fast drawing graphs, but for calculations.)
Note, that all graphs, drawn by Expression are computed during they
are painted. There are no arrays or other tricks to increase the
performance.
Examples on using ExEngine from C / C++:
----------------------------------------
void func()
{
long pcode_handle;
double x, result;
ExpBindVar(hExp, "x", &x); // exports the variable's address to engine
if (ExpGetErr(hExp))
handle_error(); // perhaps the variable "x" is already defined ?
// (lack of memory problems are handled also)
pcode_handle = ExpParseAndStore(hExp, "sin(x * 3) + sin(x)"); // just compiles - the storage of the pcode is managed by the engine
if (ExpGetErr(hExp))
handle_error(); // try possible error-conditions with the "Expression Dialog"
// all error messages are directly generated by the engine!
// (lack of memory problems are handled also)
for (x = 0; x <= 1; x += 0.01)
{
result = ExpEval(hExp, pcode_handle); // execute the pcode - all current variable values are used
if (ExpGetErr(hExp))
handle_error(); // perhaps division by zero or something else...
printf("f(%g) = %g\n", x, result);
}
ExpRemoveVar(hExp, "x");
}
void func2()
{
double result;
ExpDefineVar(hExp, "x", 3.14); // creates variable within the engine, initial value is 3.14
if (ExpGetErr(hExp))
handle_error(); // perhaps the variable "x" is already defined?
// (lack of memory problems are handled also)
result = ExpParseAndEval(hExp, "sin(x * 3) + sin(x)"); // directly compiles and evaluates
if (ExpGetErr(hExp))
handle_error(); // perhaps the variable "x" is already defined ?
// (lack of memory problems are handled also)
printf("for x=%lg the result is %lg", ExpGetVar(hExp, "x"), result);
ExpSetVar(hExp, "x", 1.57); // sets variable x to value 1.57
result = ExpParseAndEval(hExp, "x^3 + 5.43");
if (ExpGetErr(hExp))
handle_error(); // perhaps division by zero or something else...
printf("for x=%lg the result is %lg", ExpGetVar(hExp, "x"), result);
ExpRemoveVar(hExp, "x"); // remove variable definition from engine
}
The number of variables (exported or created) and the number of
stored expressions is only limited by available memory.
============================
IV.1 Distribution and Prices
============================
The engine is available as an evaluation - or "home" - version, i.e.
you may use it for a lifetime, but you must not give away the engine
to other persons.
The evaluation version costs $99 per platform.
If you decide to develop software with it that you want to distribute,
you can get the licensed version for $499 ($400 if you bought the
evaluation-version before) per platform. This allows you to
distribute "ExEngine" with your applications completely license-free.
Contact me for special conditions if you want to buy the C++
source code.
Both, the evaluation- and the licensed-versions are shipped with full
documentation on disk and the source code of "Expression" as an example.
So far the kernel of "ExEngine" has been tested on 68K CPU based
machines (originally developed on 68K platform and unchanged
since then), on SCO-UNIX, OS/2, DOS and Windows. I think this is
proving the quality of the source-code.
ExEngine is since 1991 under development, the call-interface and
internal data structures have been re-worked several times for
best usability and performance.
I believe that ExEngine is bug-free. If you encounter any bugs,
please let me know.
The porting to other platforms will follow upon requests.
=====================================================
V. Coming soon: "VPEngine" - The Virtual Print Engine
=====================================================
Windows has made printing for programmers easier.
VPEngine makes it really simple. - Create most complex documents
by programming them in an really easy way.
Open as many virtual documents as you want.
Use colors, lines, circles, frames, boxes, bitmaps, charts, and
and and - for sure - text.
Give all drawing coordinates in 1/10 mm or 1/1000 inch.
Use all text-formatting features (left, right, centered, justified,
bold, italic, underlined).
Create table- and sub-table-templates on-the-fly (this means while
printing is in progress) to fill them with data.
Print 100 virtual pages and move virtually to the first page to put in
some new data or to remove or just MOVE objects on the page (or to
other pages), change objects in size or it's contents or any other
attributes. (Everything you draw is in the world of VPE an Object.)
Don't care about the printer - it's resolution or printing-offset (this
is the offset on the page the printer cannot print on) - your document
will look on every printer as much the same as technical possible.
Don't care about previews and printing-dialogs - VPEngine does it
for you.
Show the user a preview, let him make choices in your program,
then rework the report while letting the preview open (or hide it).
If you leave it open let the user watch the printing data change while
your program is working on it. This gives you the possibility of
INTERACTIVE printing.
Let the user zoom scale-free through the preview since it's true
WYSIWYG-Vector-Graphics!
In fact VPEngine renders all objects in a virtual 2540 x 2540 dpi
resolution and then transforms it to the specified device, be it the
screen, a printer, a fax or whatsoever.
This gives best possible WYSIWYG results.
Using special, optimized algorithms (since 1993 under development),
VPEngine is really FAST!
This is OPTIMAL for filling pre-printed forms with data, it's also
optimal for such complex reports where a normal generator fails or
needs 10 times more work to implement.
Use it in the same way like Expression from any programming language
that supports the DLL-calling conventions. (like C/C++, Pascal, Basic,
SQLWindows and so on)
VPEngine is database independent since you feed it with the
needed data in such a simple way, you won't believe.
Additionally there is a layout-tool under development for designing
templates (reports) simply with the mouse by point-and-click operations.
VPEngine will be fair in price and license free.
The Virtual Print Engine for Windows ▀-Version will be released
in late summer 1995.