RE: gROOT->Reset("a")

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Tue, 15 May 2007 15:41:24 -0500


Hi,

You can not call gROOT->Reset from within a function (it remove the definition of
the function being executed ....).

Your only solution is to use an unamed macro:  

{

    gROOT->Reset("a");
    gROOT->LoadMacro("myscript.cpp");     cout << " hello world " << endl;
}

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Jochen Mikosch
Sent: Tuesday, May 15, 2007 3:10 PM
To: roottalk_at_pcroot.cern.ch
Subject: [ROOT] gROOT->Reset("a")

Hi,

I would like to use gROOT->Reset("a") to clean up before executing my program. On the command line it works fine, but within a script (see example below) the error message is :

root [0] .x test.cpp
Error: Unexpected EOF G__exec_statement() test.cpp:6: Advice: You may need to use +P or -p option *** Interpreter error recovered ***

Without option "a" it works fine, but I need this option to avoid some reload problem. I tried root versions 5.11 and 5.12.

#include "TROOT.h"
#include "TSystem.h"

void test()
{

    gROOT->Reset("a");
    gROOT->LoadMacro("myscript.cpp");     cout << " hello world " << endl;
}

Any suggestions how to solve that?

Cheers,
 Jochen Received on Tue May 15 2007 - 22:50:16 CEST

This archive was generated by hypermail 2.2.0 : Wed May 16 2007 - 17:50:02 CEST