Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / wxString toDouble parser

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. wxString toDouble parser
#4374
Posted by: 2004-06-08 06:10:14
I hope someone will help me with this problem:

I want to convert a wxString like "2*sin(x*5)+2" to a double (or long if thats better :-). If I just convert it, nothing happens, because it won't read letters, operators and things like that. I think I need to make a parser or something, but I have no idea how to do so.

It's for an equation grapher, if that could be useful.

Can anybody help me? :-)
Message2. Re: wxString toDouble parser
#4385
Posted by: upCASE 2004-06-08 15:14:01
Hi!
I guess you mean you want to read in a string, compute the expression and give the correct result. Yes, that implies parsing :)
Check http://www.xs4all.nl/~jorgb/wxGoldParser.html it seems to be cool.
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: wxString toDouble parser
#4537
Posted by: 2004-06-19 04:42:37
Hi

Thank you very much for your answer, upCASE. But I've tried the get the GOLD Parser to work, but I couldn't. Would you or somebody like to help me with some examples, how to compile it, and an example how to parse a wxString, compute the expression and get the result into a double or float.

If thats possible, I think I know how to use the GoldParser ;)
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-3-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0