ProcessLine return value


Sorry for disturbing,

I have a very simple question about the value returned by gROOT->ProcessLine();

For example, I have the following script (func.C):

Long_t func()
Long_t val = 1.5;
return val;

and then if I try to get the returned value in ROOT I always get an integer (though it is still displayed as Long_t):

root [0] Long_t val2 = gROOT->ProcessLine(".x func.C");

Is there any correct way to get the returned value ?



I am not sure to understand your question. The result of gROOT->ProcessLine is always a Long_t
If you use the interpreter and want to return the exact type of your function, do

root > gROOT->ProcessLine(".L func.C"); root > func();

Hello Rene,

Thank you very much !

This is exactly what I wanted !

And sorry for being not very clear with my initial question.

Thanks again,