Страница 1 из 1

Evaluation

Добавлено: 12 мар 2008, 09:56
Sench4
HI ALL

If I have a value of type VARCHAR Ex. '3+(5-2)/3' How can I evaluate this to get value of type INTEGER 4 ?

Thanks

Re: Evaluation

Добавлено: 12 мар 2008, 15:15
Владимир
I think, you should write your own string parser

Re: Evaluation

Добавлено: 12 мар 2008, 15:33
somewhere
I think your main task is to parse expression on constants, operations and functions. Because of operations have an evaluation priority you can present them as tree nodes. Then you start evaluate from the most distant node up to root.
Also the easiest way is to use already done functions from imported dll's, you'll easy get it from web.