TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
-
Clara Genermont
- Newbie
- Posts: 42
- Joined: Mon Jun 11, 2007 12:00 am
-
Contact:
Post
by Clara Genermont » Tue Nov 25, 2008 2:12 pm
Hi Narcis,
here is my code :
Code: Select all
PROCEDURE TForm1.TeeFunction1Calculate(Sender: TCustomTeeFunction;
CONST x: Double; VAR y: Double);
BEGIN
IF (Edit1.Text = Null) OR (Edit1.Text = '') THEN exit;
y := StrToFloat(Edit1.Text);
END;
PROCEDURE TForm1.Edit1KeyDown(Sender: TObject; VAR Key: Word;
Shift: TShiftState);
BEGIN
IF key = VK_RETURN THEN
Series1.CheckDataSource;
END;
if I put
x+2 in edit1 and hit the return key
I have
EconvertError message
Can you help me ?
Didier
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Fri Nov 28, 2008 10:48 am
Hi Didier,
Sorry for the delayed reply but I needed to do some investigation on this field.
The only solution I can think of to solve this is using a mathematical formula expression parser.
Dew Research's
MtxVec 3.5 includes TMxParser which can easily handle this. You can download a trial version here:
http://www.dewresearch.com/downloads-delphi.html
Demo, available
here, includes several parser examples, together with full TeeChart support.
-
Clara Genermont
- Newbie
- Posts: 42
- Joined: Mon Jun 11, 2007 12:00 am
-
Contact:
Post
by Clara Genermont » Fri Nov 28, 2008 1:54 pm
Hi Narcis,
Sorry you have asked to quickly ..
The solution you propose (parser) is interesting but seems too heavy for the moment ..
the error message is:
The project caused a Project1.exe class EConcertError exception with the message "x+2' is not a floating point value correcte.
I am not trying to solve all sorts of falling to a function to analyze ..
I would like to write a simple processing chain that sets the sake of "x+2'
the concern seems to be: "
Thank you very much for your help
Didier