Processline

Hi
It is surely stupid question, but I can’t find resolve.

void test(){ double n=gROOT->ProcessLine(".x test.C"); cout<<n<<endl; }where test1 is:

double test1(){ return(4);} I have a message:

[quote]root [17] .x test.C
(double)4.00000000000000000e+00
0[/quote]so n==0, not 4, why? I want of course return some value from test1 to test.
I can declare global variable in test.C, but this is not good choice…

regards,
jimmij

Hi,

ProcessLine does not return a value. Use ProcessLineFast instead:

void test(){ gROOT->ProcessLine(".L test1.C"); double n=gROOT->ProcessLineFast("test1()"); cout<<n<<endl; }
Cheers,
Philippe.