home *** CD-ROM | disk | FTP | other *** search
- unit DynamicMath;
-
- { Dynamic Math. A library to parse and interpret formulas during }
- { the programs execution time }
- {}
- { © 1993 by Christian Franz }
-
- interface
-
- const
-
- eClsExpected = -1; (* ")" expected *)
- eOpnExpected = -2; (* "(" expected *)
- eUnknownSymbol = -3; (* unknown function *)
-
- {$PUSH}
- {$J+}
-
- type
- (* The Item object is just defined so your *)
- (* compiler doesn't gag on the Formula *)
- (* definition. Don't change or even use it! *)
- Item = object (* don't ever mess with me *)
- thevalue: real;
- negate: boolean;
- function evaluate: real; (* no you don't *)
- end;
-
- Formula = object
- structure: Item;
- function evaluate (x, y: real): real;
- (* call me to evaluate parsed function *)
- end;
-
- var
- gPos: integer;
-
- {$J-}
- {POP}
-
-
- procedure Str2Text (s: Str255; var t: CharsHandle);
-
- function Parse (text: CharsHandle; var theFormula: Formula): Integer;
-
- implementation
-
- end.