Hello!
I am in troubles with calling interpreter function from compiled code.
Let's say I have compiled class
class TMyClass {
private:
Float_t (*fFunc) ();
public:
void SetFunction(const char* Macro);
Float_t Function() { return (*fFunc)() }
};
and a macro in Macro.C file
Float_t
MyFunc()
{
printf("the answer is ...\n");
return 42;
}
now I would like to write in my compiled program:
TMyClass *MyClass = new TMyClass();
MyClass->SetFunction("Macro.C");
Float_t Answer = MyClass->Function();
How TMyClass::SetFunction(const char* Macro) should look like? I am sure you
suggest me to look into TF1 implementation, but could you write a few lines
of example code instead? I hope it helps others too ...
Best regards,
Anton
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:20 MET