How to execute a string as a method?
rod178:
How to execute a string as a method?
if(methodString== "MyMethod()") MyMethod();
GumRai:
Not the solution I was looking for
I desire to enter the methods dependent on variable values created. This would include overloading.
angevoyageur:
You then have to use OOP and pointers.
You then have to use OOP and pointers.
Yes, that is an option, although I was hoping that a more direct approach was available, as is in some other languages.
eg
eval 'MyMethod()' # Ruby code to execute a method from a string
rod178:
Unfortunately not.
Yes, that is an option, although I was hoping that a more direct approach was available, as is in some other languages.
eg
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register