EVAL (c) 1993 by Alexander Walter WHAT IS IT? =========== EVAL is a mathematical expression evaluator for QuickBasic. The expression must be in correct QuickBasic syntax, and can include functions such as SQR(), ATN(), COS(), etc. Correct hierarchy of mathematical evaluation is observed. Format of the result is decimal by default, but can be made hexadecimal or octal. REGISTRATION INFORMATION ======================== EVAL is offered as shareware. For a very modest $15 registration fee, you will receive the QuickBasic source code for EVAL. By registering, you can incorporate this sort of function into your Basic programs. Register by sending check or money order to: Alexander Walter 182 ILER Dr. Middletown, NJ. 07748 (800) 262-0827 USA only (908) 949-0507 or (908) 671-5080 otherwise USING EVAL ========== EVAL reads the command-line, and evaluates it as a valid QuickBasic mathematics expression. The syntax for using EVAL is: eval where is a mathematical formula in QuickBasic syntax. For instance, the following are recognized and evaluated: eval 5 * sqr(30) eval 10 * log10(0.05) eval cos(pi/8) eval sqr(5.6e+3) eval hex$(32 + &h100) eval oct$(64 + &o777) eval 19.93 * (1.05^(-1/3) - 1) eval sinh(sinh(sinh(.01))) EVAL honors the algebraic operator hierarchy. At equal levels of parentheses nesting, algebraic operators are evaluated in the following order: ^ exponentiation - negation *,/ multiplication and division \ integer division MOD modulo arithmetic +,- addition and subtraction Logical operations: NOT, AND, OR, XOR, EQV, IMP Relational operations ( =, >, <, <>, <=, >= ) are not presently supported. Eval recognizes the following intrinsic QuickBasic functions: SIN() COS() ATN() SQR() ABS() INT() LOG() SGN() TAN() CINT() EXP() MOD AND OR XOR IMP EQV The following mathematical functions are also evaluated by EVAL, even though they are not intrinsic QuickBasic functions. In the source code, registered users can easily see how to add more functions. SINH(): Hyperbolic sine COSH(): Hyperbolic cosine ARCSIN(): Arc sine ARCCOS(): Arc cosine LOG10(): Base 10 logarithm All sinusoidal functions are evaluated in radians. The following symbolic constants are also understood by EVAL. In the source code, registered users can easily see how to add recognition of other symbolic constants. PI = 3.141592653589793# Numeric constants are interpreted as decimal by default, but they can be interpreted as hexadecimal by prefixing the constant with "&h". Constants can be interpreted as octal by prefixing them with "&o". For instance, 65 = &h41 = &o101. The different representations can be mixed in the same expression. The format of the output is decimal by default, but can be made hexadecimal by enclosing the expression with "hex$()". The format can be made octal by enclosing the expression with "oct$()". For instance: COMMAND RESULT --------- --------- eval 65+65 130 eval hex$(65 + &o101) 82 (hex) eval oct$(&h41 + &o101) 202 (octal) With hexadecimal or octal output formatting, any fractional part of the result is truncated. MISCELLANEOUS NOTES =================== If you are using the 4DOS replacement for Microsoft's COMMAND.COM, 4DOS appears to interpret the exponentiation symbol "^", and prevents it from being passed to EVAL. For this reason, the tilde character "~" is also recognized as an exponentiation symbol. EVAL does not process statements that have adjacent exponentiation and negation, such as "4^-2". Instead, use parentheses such as "4^(-2)". OTHER SHAREWARE PRODUCTS AVAILABLE: ================================== FONTEDIT: -------- View & edit any HP LaserJet bit-mapped soft font. Requires VGA/EGA/CGA/Herc or AT&T video. Mouse optional. Handles portrait or landscape, fixed or proportional, and can convert between them. Handles up to 110 pt (VGA), 80 pt (EGA), 88 pt (Herc & AT&T), or 44 pt (CGA). Sculpt individual pixels, or use the many built-in special effects and area shapes. Can import characters from black & white .PCX, .TIF, or from other soft fonts. Many features. TT2BMAP: ------- This program can convert a TrueType font into bitmapped, so that older DOS programs that don't understand TrueType can still use the latest fonts.