gInterpreter->Execute

Hello.

Which kind of member-functions can be called through
gInterpreter->Execute ? How can I check the value my member-function return if I call it through gInterpreter->Execute ?

Hi,

[quote=“tpochep”]Which kind of member-functions can be called through
gInterpreter->Execute ?[/quote]Any function with a dictionary should work.

Cheers, Axel.

Hi,
one can also use CINT API directly.
G_calc, G__exec_text, G__process_cmd, G__CallFunc
See root.cern.ch/root/Cint.phtml?ref

Regards. Valeriy

[quote]Hi,
one can also use CINT API directly.
G_calc, G__exec_text, G__process_cmd, G__CallFunc
See root.cern.ch/root/Cint.phtml?ref
[/quote]

LOL. Very “good” idea :slight_smile:))

I have

MyClass:SomeFun(int a, int b);

I want to call it (yes, my class has dictionary). How can I pass arguments for ‘a’ and ‘b’ (fortunatly, I can skip result testing)

Hi,
as I (almost) said:

MyClass myObject; // calling const char* MyClass::SomeFun(int, TObject*) as myObject.SomeFun(42, anotherObject) const char* name = (const char*) gROOT->ProcessLine(Form("((MyClass*)0x%x)->SomeFun(%d,(TObject*)0x%x))", &myObject, 42, anotherObject)); Or use TInterpreter::Execute(); check the comments in the source: root.cern.ch/root/html/src/TCint.cxx.html#OLtVzC I’d recommend the ProcessLine approach, though.
Cheers, Axel.

Hi, Axel.

Thank you!!!