Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!helios!sheaf From: sheaf@helios (Sheaf) Newsgroups: comp.sys.ibm.pc.misc Subject: Programming Question Summary: Defining functions by user input. Message-ID: <142295@unix.cis.pitt.edu> Date: 20 Jun 91 16:47:15 GMT Sender: news@unix.cis.pitt.edu Distribution: usa Organization: University of Pittsburgh, Department of Physics and Astronomy Lines: 25 Here is a programming problem that's been driving me nuts for some time now, and I'm hoping someone can shed some light on this for me. I use several languge compilers including Pascal and several versions of BASIC, but it's sort of unimportant since my problem is the same with all of them. I am developing some mathematical software utilities, and very simply, I want the user to be able to enter a function on the screen and have it graphed by the program. Sounds simple enough, and I have some great 2D and 3D graphing routines, but the problem is this: in order to graph something, you have to define it as a function, and while the coefficients in the DEFINE statement can be variables, the expression itself has to be hardcoded. Also, the DEFINE statements can't define a function from a string variable with the expression stored in it. So, to put it simply, is there any way (in any language) to define a function bby user input ? I know it can be done, I have software that does exactly this, but for the life of me I can't figure out how. If you have any tips, please E-mail me. Steve Sheaffer sheaf@groucho.phyast.pitt.edu