"StrToDouble" - someone please?

|
|
|
Patrik
|
|
OK, here's my problem:
I have this function function TForm1.Romberg1Integrand(x: Double): Double;
In Delphisourcecode this function shall looks this:
function TForm1.Romberg1Integrand(x: Double): Double; begin Romberg1Integrand := x*x; end;
My problem is, that I want to define the Romber1Integrand in runtime: The user may select a function (in this case it is "x*x") from a ComboBox and the string shall be used as the function. Any idea on how to do this, it's really important!
Any help is apreciated, thanks in advance.
|
|
Posted 24 years ago (Thread Starter)
|
|
| About Patrik |
|
Membership pending.
Member subscribes to this thread but email is NOT VERIFIED.
|
Email Not Verified!
Once email is verified, we will review and approve the account.
|
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #5588, 2 replies
Thread Started 3/20/2002 11:27:00 PM
View Counter=9541
Last Reply Posted 6/23/2002 11:42:00 PM)
|
|
|
|
Location=-- USA
|
|
 |
Most Recent Post
|
|
|
NevilleRichards
|
Assuming you have a finite (and reasonable) number of functions you want to implement, then one trick is to set-up a separate pascal function for each one, and then use type fType = function(d:double):double to form an array of pointers to them so that you can index them from the selected variable of the combo box. Alternatively, simply use a series of if/then statements to compute the appropriate value, given the function required. Neville 
|
|
Posted 24 years ago
|
|
| About NevilleRichards |
|
Inactive member.
Member does not subscribe to this thread.
|
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
|
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #5686 (Level 1.1)
Reply to 5588
Thread Started 4/2/2002 5:52:00 AM
View Counter=2
|
|
|
|
Location=UK
|
|
 |
|
|
|
Angel
|
|
I dont think I really understand what your driving at! Are you saying that in the combobox the user can select RombergIntegrand1 and then the program calls that function, or does the user select X*X?
|
|
Posted 24 years ago
|
|
| About Angel |
|
Inactive member.
Member does not subscribe to this thread.
|
Email Not Verified!
Once email is verified, we will review and approve the account.
|
|
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html,
social networking links, message board signature, company profile, etc.
|
Post ID #5590 (Level 1.2)
Reply to 5588
Reply Posted 3/21/2002 2:43:00 AM
|
|
|
|
Location=England
|
|
Revive Thread!
Add a comment to revive this old thread and make this archived thread more useful.
| Thread #5588 Counter |
| 9541 |
|
Since 4/2/2008
|
|
|