Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

convert equation formulas to text string

50 views
Skip to first unread message

Peter

unread,
Nov 21, 2001, 11:38:30 AM11/21/01
to
hi,

how can i convert equation formulas to a text string in delphi 5 ?

i'm thinking about eg the microsoft word equation editor, and the formula
typed in has to be converted to a simple text string.

anyone got an idea ?

thanks.


Fernando Martins

unread,
Nov 22, 2001, 5:13:34 AM11/22/01
to
Hi

Yes!
You may do what everyone does, even Delphi does it, use a parser and a
grammar! Use only unary and binary functions.

Example:

X/2 you could transform it in the string 'Div(X, 2)'.

(X/2) + 4 would be 'Add((Div(X, 2)), 4)'

(X/2) + 4 = 10 would be 'Equal(Add((Div(X, 2)), 4), 10)'

I think this is what you were looking for...

Best regards,
--
Fernando Martins
_____________________________________
Altitude Software - R&D Server
-------------------------------------
Av. dos Combatentes, Nº 43, 8º
1600-042 Lisboa, Portugal
Office: +351 217 205 139
Fax: +351 217 205 090
URL: http://www.altitude.com
_____________________________________

Why live on the edge if you can jump from it ?

Peter

unread,
Nov 22, 2001, 8:08:29 AM11/22/01
to
Hi Fernando,

what i really want, is to make a formula in an equation editor (of in
microsoft word), and automatically convert this to a string (eg
sqrt(a/b)+1600*c).

Peter

"Fernando Martins" <fernando...@altitude.com> wrote in message
news:3BFCCFC9...@altitude.com...

Fernando Martins

unread,
Nov 22, 2001, 8:44:51 AM11/22/01
to
Hi.

> what i really want, is to make a formula in an equation editor (of in
> microsoft word), and automatically convert this to a string (eg
> sqrt(a/b)+1600*c).

Oh, sorry, did not understood your first post then...
Sorry, but in that I think I cannot help you with...
Maybe exploring the objects that link to MS Word would be a start...

sup...@bestcode.com

unread,
Jan 12, 2014, 8:43:00 PM1/12/14
to
Delphi 5 or Delphi XE5, either way TbcParser is the way to go! There are formula parsers for many languages at http://www.mathparsers.com/ C++, Java, Objective C, C#, Delphi, COM (vb 6 anyone?) are all covered by a suite of math parser libraries. Most of them support strictly mathematical formulas in the expression to parse. C# version supports strings in the expression as well. Users can define their own variables and user defined functions to use in the expressions.
0 new messages