ProcessLine return value

Hello,

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");
(Long_t)1

Is there any correct way to get the returned value ?

Thanks,

Kirill

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();
Rene

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,

Kirill