Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!hsdndev!cmcl2!adm!news From: winfmni%DUTICAI.TUDELFT.NL@uga.cc.uga.edu Newsgroups: comp.lang.pascal Subject: Re: evaluating Message-ID: <26532@adm.brl.mil> Date: 11 Apr 91 11:02:32 GMT Sender: news@adm.brl.mil Lines: 20 Hi, > Is it possible (and if so, how) to have a compiled Turbo Pascal > program read an equation from an ascii file and process it as > an equation? As I recall, the Turbo Pascal package contains an example program TCALC (a spreadsheet). Within the spreadsheet, there is a little parser for evaluating expression, taking strings as input. That should be a start. If you need *speed* though, consider translating the string expression to a tree representation and evaluate the tree (so that you won't have to parse the string over & over). I have a version of the last code lying around somewhere, if you're interested I can try to dig it up but it will take some time :-) Hello! -- Ir. M.H. Nieuwmans | e-mail winfmni@duticai.tudelft.nl Delft University of Technology | Phone 31 15 783823; home 31 70 3914080 Department of Information Systems