Delphi Prism:替代 TMathparser 类来评估复杂表达式?
在Delphi中,我使用称为Tmathparser的组件来评估表达式以获取答案。我正在尝试使其在Delphi Prism中工作,但它的工作状况不佳。实际上,错误太多了。因此,我想知道是否有类似的东西可以与Delphi Prism一起使用。
谢谢,
In Delphi, I use a component called TMathparser to evaluate an expression to get an answer. I am trying to get it to work in Delphi Prism and it is not working out too well. In fact, there is just too many errors. So, I was wondering if there is something similar that will work with Delphi Prism.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发布课程希望对其他人有所帮助。
正如 David 所指出的,我想我必须在这里发布这个,否则我将不得不完全删除我的答案:
这是 Prism 的 Mathparser 类的修改版本:
这是方法 MathParseronGetVar 的实现细节:
这是人们将如何使用MathParser 类。顺便说一下,这个类可以轻松处理复杂的表达式。
我认为您可能仍然需要修改 Mathparser 才能使用您的程序,但这会非常简单。
I am posting the class in the hope that it might help others.
As pointed out by David, I think I have to post this here or I will have to completely remove my answer:
Here is the modified version of Mathparser Class for Prism:
Here is the implementation detail for method MathParseronGetVar:
Here is how one would use MathParser class. By the way this class will easily handle complex expression.
I think you may still need to modify Mathparser to work with your program, but it would be very simple.