Evaluateur d'équation pouvant prendre jusqu'à 5 paramètres (extensible)

Description

Un composant (C++Builder) qui hérite de TCustomEdit et qui vous permet de saisir une expression mathématique pouvant prendre jusqu'à 5 variables (vous pouvez rajouter autant de variables que vous voulez).
Il vous permettra par exemple d'évaluer l'expression à partir de valeurs saisie, ou encore de représenter graphiquement des fonctions dont vous avez saisie l'expression.
Le composant s'accompagne de 2 exemples d'utilisation.

Conclusion :


All right reserved Copyright (c) 2006
>>mskhelladi<<
MathComp beta version
EquationEdit 1.00
FOR
C++BUILDER 5 & 6

1. What's this for?
-------------------

EquationEdit is a component which inhirit all his properties, methods and events
from a TEdit class and on which you can write without any fuss a math expression
(without or with variables) (what? what I mean by math expression and variables?
that mean 1+1 or simply sin(exp(x/(sh(x)-3.15)^0.12) in this case x is the variable)
and get the numerical value of the expression.


2. What about EquationEdit's new properties and methods?
--------------------------------------------------------

The additionnal property is :

__property int NVar={read=GetNVar,write=SetNVar};

1st) NVar is a 'published' property.
2nd) 'N' means N-umber and 'Var' means Var-iable: so N+VAR gives NVar.
3rd) Nvar is always <= 5 (and >=0 of course)(sorry, you can't exceed 5 variables (x,y,z,a and b), UNLESS!
you change the source code...
4th) the default value of NVar is 1.
That's all for NVar.

The additionnal method is:

double Value(bool go,...);

1st) 'Value' is a public method.
2nd) the argument 'go' allows the calculation when it takes the value 'true'.
3rd) the '...' means that you can put as many variables as you wish (not realy 'as you wish' but let's say
5 variables (arguments)) according to the value of NVar. That's very important so follow me carefully, when
you put your variables (in '...') the 1st position corresponds to 'x' and the 2nd,3rd,4th and 5th respectively
to 'y,z,a and b'. Don't forget that we are dealing with the NUMERICAL values of 'xyzab'. (don't worry! if you
are not silly you'll understand more by the exemples and by seeing the source code in .cpp and .h).

3. How do I extract the .exe?
-----------------------------

Double click (or click once according to your OS settings) and specify a directory in which you wish to extract
the files (I advice you to extract all the files in a directory within the Builder root for exemple
C:\Borland\BCB5\NewComp).

4. What do I do with these files?
---------------------------------

AH! - Click (twice or once according to your OS settings) on EquationEditBCB5.bpk.
- Then, click on "install" button, at the package box.

or - Run C++Builder5, and close all the current projects.
- go to Component->Insall Component->Into new package, then specify the position of the Unit file
name and the Package file name. Press OK.
- Then, click on "install" button, at the package box.

If you need even more explicit information, well, here's a table (*backup any existing files first*,
if you are at all worried about that kind of thing ... I always do):
[I'll assume you know where you installed Builder, and I'll call it's directory
"BCB_Root" and "NewComp" the directory where you extracted the files, for the sake of sanity.]

File Destination Description
==== =========== ===========
EquationEdit.cpp BCB_Root\NewComp Unit file name
EquationEditBCB5.bpk BCB_Root\NewComp Package file name

5. OH SHIT! IT DIDN'T WORK!
----------------------------

Um, it SHOULD have. Contact me (if you get stuck or whatever) at:

mskhelladi@yahoo.com
sofiane.khelladi@gmail.com



6. Now what?
------------

Take a look on the exemples for more details.

I hope you will find this component usefull! :)
>>>>>>don't forget to Send me your comments.

Thanks.

Codes Sources

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.