home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- EVAL
-
- An expression evaluator for QuickBasic 4.5
-
- Version 2.00
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [c] 1991,1992 Applied Design Group, E 3707 Pacific, Spokane, WA 99202
-
- (509) 535-7829
-
-
-
-
-
- Table Of Contents
- ____________________________________
-
-
- License Policy 1
-
- Disclaimer 2
-
- Introduction 4
-
- Using EVAL 5
-
- Function Reference 7
-
- Registration Information 13
-
- Other Applied Design Group Products 14
-
- Order Form
-
-
-
-
-
-
- License Policy: Page 1
-
-
-
-
-
- EVAL and its documentation are copyright [c] 1991,1992 by
- Applied Design Group all rights reserved. EVAL may not be
- circulated in any incomplete or modified form, nor sold for
- profit, without written permission of the author. You may
- use the unregistered shareware version of EVAL for a reasonable
- evaluation period. After the evaluation period, you must either
- register EVAL or discontinue its use. If you register EVAL,
- you may continue to use the unregistered EVAL program until
- you receive the registered version.
-
-
-
- If you distribute this software to others, you are required to
- distribute the ENTIRE package consisting of the following files:
-
-
- EVAL20.QLB - EVAL Quick Library
- EVAL20.LIB - Standard Microsoft Library
- EVAL720.QLB - Same as above except for
- EVAL720.LIB - PDS 7.1 instead of QB 4.5
- EVAL.BI - Include file for your application program
- EVAL.DOC - EVAL Documentation
- CALC.BAS - Sample EVAL application
- CALC.EXE - Sample executable
- CALC.MAK - QuickBasic make file
- CALC.BAT - Batch file to load calc and the quick lib
- README - Read file
-
-
-
- Commercial sale: Page 2
-
-
- Any software dealer or library may distribute the entire
- EVAL Shareware package in an unmodified form for a fee as long as the
- price charged for the disk containing EVAL Shareware does
- not exceed US $10.00.
-
-
- With this single exception, the sale of EVAL or its parts for profit,
- either by itself or as part of a compiliation or development tool
- or library which includes all or a portion of EVAL requires a licensing
- agreement providing for royalty payments. Please write for terms.
-
-
- The use of EVAL routines in your commercial or shareware programs
- requires you to register your copy prior to distributing said
- programs, in addition your program must contain a valid copyright
- notice, your copyright notice or the letter 'c' enclosed in
- parenthesis and the word "Copyright" and the year(s) of publication
- is sufficient.
-
-
- In NO EVENT may you use any of the routines in EVAL for commercial
- purposes until you register your copy.
-
-
-
-
- In other words:
-
- You cannot sell or distribute any program which contains EVAL
- routines either commercial, public domain, or shareware, whithout
- registering your copy prior to distribution.
-
-
-
-
-
- Disclaimer: Page 3
-
-
-
-
-
-
-
-
-
-
- This software (EVAL Shareware) is provided on an "as is" basis without
-
- warranty of any kind, expressed or implied, including but not limited
-
- to the implied warranties of merchantability and fitness for a
-
- particular purpose. The person using the software bears all risk as to
-
- the quality and performance of the software. Should the software
-
- prove defective, the user assumes the entire cost of all necessary
-
- repair, servicing, or correction. The author will not be liable for
-
- any special, incidental, consequential, indirect or similar damages
-
- due to loss of data or any other reason, even if the author or an
-
- agent of the author has been advised of the possibility of such
-
- damages. In no event shall the author's liability for any damages
-
- ever exceed the price paid for the license to use the software,
-
- regardless of the form of the claim.
-
-
-
- Introduction Page 4
-
-
- EVAL 2.00
-
-
- EVAL is an expression evaluator for the QuickBasic programmer.
- With EVAL your program can evaluate user entered mathematical formulas
- and expressions. You simply pass a string containing the formula to
- EVAL and the numeric value is returned :
-
-
- expr$ = "4*(3.14*2)^2*(3+4) + sin(rad(24)* sqr(2))"
-
- Anser# = Eval#(expr$, err$)
-
- It's that simple !
-
-
- This is a shareware product, you may try EVAL to see if it fits
- your needs. If after a reasonable period of time you find you
- are still using EVAL you must register. By registering this product
- you will receive the latest version and COMPLETE SOURCE CODE you
- will also recieve a printed manual, technical support and a subscription
- to our quarterly newsletter for one year.
-
-
-
- Compatibility
-
-
- EVAL can be used with QuickBasic 4.5 or PDS 7.1. The QB 4.5
- libraries are EVAL20.QLB and EVAL20.LIB the PDS libraries are
- EVAL720.QLB and EVAL720.QLB.
-
- If you have the source code it may also be compatible with the
- following versions of BASIC.
-
-
- Turbo Basic
-
- Power Basic
-
-
- If there is a question of compatibility just drop us a line or call
- 8:00 AM to 5:00 PM Pacific Time.
-
-
- Applied Design Group
-
- (509) 535-7829
-
- Using EVAL Page 5
-
-
-
- EVAL is contained in a quick library. To use simply include the quick
- libary on the command line when you load your application program.
-
-
-
- QB myapp /leval20
- _________
- |
- -------------- The libarary spec
-
-
-
- The EVAL Function takes two string arguments and returns a DOUBLE
- precision float. The string arguments are :
-
-
-
- 1: the expression to be analyzed
- 2: an error variable (should be "" on entry)
-
-
- If an error occured during evaluation the error variable will contain a
- string representation of the error. Otherwise, the error variable will
- be NULL or empty.
-
-
- EVAL can handle the following operators:
-
- + - addition
- - - subtraction
- * - multiplication
- / - division
- ^ - exponentiation
- () - parenthesies
-
-
- And the following functions:
-
- SIN COS TAN ASIN ACOS ATAN HSIN
- HCOS HTAN AHSIN AHCOS AHTAN RAD DEG
- ANGLE SANGLE RADIUS POLX POLY LN LOG
- LOGN SQR ABS CEIL FLOOR EXP FRAC
- INT MOD SGN FIX RND FACT RES
- PI
-
- Page 6
-
-
- EVAL can handle full floating point syntax, All of the following are
- legal numbers in EVAL expressions:
-
- 4
- 4.5
- -2.3
- 67.9809E23
- 34.45E-2
- -3.4E-2
- 0.001
-
-
- The following is NOT a legal number:
-
- .001
-
- EVAL requires fractional values to be preceeded by a zero.
-
- ie: 0.001
-
-
- You only need to include EVAL.BI in your application and call EVAL when
- you need expression evaluation:
-
-
- '$include 'eval.bi'
-
- ...
- ...
-
- Result# = Eval# (expression$, expression.error$)
-
-
- Thats all there is to it !
-
-
- --------------------- WARNING ----------------------
-
-
- With version 2.0 of QBEVAL you may experience
- "Out of Stack Space" errors when nesting the
- additional functions
-
- ie: sin(cos(sin(cos(1))))
-
- If this occurs link your application
- from the command line using the ST switch.
- With a stack size of least 16k you should
- experience no problems with normal operation.
-
- For more information refer to page 368 of your
- "Programming in Basic" manual.
-
- ----------------------------------------------------
-
- Function Reference Page 7
-
-
- All functions require arguments to be enclosed in
- parenthesis and if there are more than one to be
- separated by a comma.
-
- ie:
- sin(0.5)
-
- polx(0.5,13)
-
-
- Functions may be nested to any level
-
- ie:
- deg(sin(angle(5,5)))
-
-
-
-
-
-
- Trig Functions
- ---------------------------------------
-
- The trig functions all take arguments as
- and return values as radians. To specify
- degrees use the conversion functions DEG
- and RAD.
-
-
-
- SIN
-
- Returns the sine of an angle.
-
-
- COS
-
- Returns the cosine of an angle.
-
-
- TAN
-
- Returns the tangent of an angle.
-
-
- Page 8
- ASIN
-
- Returns the arcsine of an angle.
-
-
- ACOS
-
- Returns the arccosine of an angle.
-
-
- ATAN
-
- Retuns the arctangent of an angle.
-
-
- HSIN
-
- Returns the hyperbolic sin of an angle.
-
-
- HCOS
-
- Returns the hyperbolic cosine of an angle.
-
-
- HTAN
-
- Returns the hyperbolic tangent of an angle
-
-
- AHSIN
-
- Returns the hyperbolic arcsine of an angle.
-
-
- AHCOS
-
- Returns the hyperbolic arccosine of an angle.
-
-
- AHTAN
-
- Returns the hyperbolic arctangent of an angle.
-
-
- RAD
-
- Converts an expression from degrees to radians.
-
-
- DEG
-
- Converts an expression from radians to degrees.
-
-
- Page 9
- ANGLE
-
- Takes an x and y coordinate and returns the polar angle
- from 0 to 359.999 degrees.
-
-
- SANGLE
-
- Takes an x and y coordinate and returns the signed polar
- angle from 0 to 180 and -0.00001 to -179.99999 degrees.
-
-
- RADIUS
-
- Takes an x and y coordinate and returns the distance to
- the origin.
-
-
- POLX
-
- Takes an angle and radius and returns the rectangualar x
- coordinate.
-
-
- POLY
-
- Takes an angle and radius and returns the rectangualar y
- coordinate.
-
-
-
- Page 10
- Logarithmic/Exponential functions
- ---------------------------------
-
-
- LN
-
- Returns the natural logarithm of an expression.
-
-
- LOG
-
- Returns the common logarithm of an expression.
-
-
- LOGN
-
- Returns the logarithm of base n, where n is the second
- argument, of an expression.
-
-
- SQR
-
- Returns the square root of an expression.
-
-
- EXP
-
- Returns the natural anti-logarithm of an expression.
-
-
-
-
-
- Page 11
- Misc Functions
- ------------------------------------
-
-
- ABS
-
- Returns the absolute value of an expression.
-
-
- CEIL
-
- Returns the smallest integer greater than or
- equal to the argument.
-
-
- FLOOR
-
- Returns the greatest integer less than or equal
- to the argument. FLOOR and INT are identical
- functions.
-
-
- FRAC
-
- Returns the fractional part of the argument.
-
-
- INT
-
- Returns the greatest integer less than or equal
- to the argument. FLOOR and INT are identical
- functions.
-
-
- MOD
-
- Returns the remainder after dividing the first
- argument by the second.
-
- ie: mod(10,3) = 1
-
- 10/3 = 3 remainder 1
-
-
- SGN
-
- Returns the sign of the argument.
-
- negative = -1
- positive = 1
- zero = 0
-
-
- Page 12
- FIX
-
- Returns the integer portion of the argument.
-
-
- RND
-
- Returns a random number. The argument is a seed and
- can be anything but zero. We reccomend you use the
- RES system variable as a seed.
-
- ie:
- rnd(res)
-
-
- FACT
-
- Returns the factorial of a number. The argument must
- be between 0 and 170.
-
-
-
-
-
-
- System Variables and constants
- --------------------------------------
-
-
- RES
-
- Returns the result of the last expression evaluated.
-
-
- PI
-
-
- Returns the value of PI to 15 digits.
-
-
-
- Registration Information Page 13
-
-
-
-
-
-
-
-
- EVAL is NOT FREE Software. If you wish to continue using EVAL
- you must register.
-
-
-
-
-
-
-
-
-
-
- Q : What do I get if I register ?
-
- A : EVAL is a complete and usable package as is however, by
- registering you will recieve the latest version of EVAL as
- well as COMPLETE SOURCE CODE for the entire package.
- So this is what you will recieve
-
-
- - EVAL with SOURCE CODE on disk
- - A Printed manual
- - Unlimited Technical Support
- - Quarterly Newsletter
- (for 1 year)
-
- $19.95
-
-
-
-
-
-
-
- Other Applied Design Group Products Page 14
-
-
-
-
- BPREP Preprocessor for the BASIC language
-
- Adds features to BASIC such as 'conditional compilation',
- 'defined constants', and 'include files'. Makes programming in
- BASIC much easier. Works with just about any version of BASIC
- and it comes in two versions.
-
- Shareware Version $19.95
- Profesional Version $34.95
-
-
-
-
-
- ASM51 8051/8031 Macro Cross Assembler
-
- A full featured Cross Assembler for the Intel 8051/8031
- series of microprocessors. Generates Intel HEX files or
- binary image output.
- $39.95
-
-
-
-
-
-
- BAS51 8051/8031 Basic Cross Compiler
-
- A BASIC compiler for the 8051 that supports most features
- of the BASIC language. Use structured contstructs
- while/wend, do/loop, block if/then. Generates good tight
- code and no line numbers are required. Get those 8051
- projects done in less time.
-
- $99.95
-
-
-
-
-
- BAS51 Professional
-
- A complete package including BAS51 Compiler, ASM51 Assembler
- and BPREP Professional, as well as several other utilities to
- help you write 8051 code.
- $149.95
-
-
-
-
- EVAL version 1.01 Order Form
- -----------------------------------------------------------------
- Make checks payable to:
- Applied Design Group
- E 3707 Pacific
- Spokane, WA 99202
- -----------------------------------------------------------------
- Qty
-
- [ ] EVAL @ $19.95 each $______
-
- [ ] BPREP Shareware @ $19.95 each $______
-
- [ ] BPREP Professional @ $34.95 each $______
-
- [ ] ASM51
- 8051/8031 Macro Cross Assembler @ $39.95 each $______
-
- [ ] BAS51
- 8051/8031 Basic Cross Compiler @ $99.95 each $______
-
- [ ] BAS51 Professional 8051/8031 Basic Cross Compiler
- Includes Macro Assembler
- and BPREP Professional @ $149.95 each $______
-
- Subtotal $______
-
- Washington residents please add 8.0% sales tax. $______
-
- Shipping and handling $3.50
-
- Total $______
-
- Diskette type : [ ] 5.25" [ ] 3.5"
-
- Payment : [ ] Check [ ] Money Order
-
- Checks and Money Orders must be drawn on U.S. banks in U.S. funds
- -----------------------------------------------------------------
-
- Name _______________________________________________________
-
- Company _______________________________________________________
-
- Address _______________________________________________________
-
- _______________________________________________________
-
- Phone _____________________ Business ______________________
-
-
- Where did you obtain EVAL?
-
- _______________________________________________________
-
- Comments _______________________________________________________
-