Re: problem with Reset in rootlogon file

From: Rene Brun <brun_at_pcroot.cern.ch>
Date: Thu, 7 Apr 2005 15:40:23 +0200 (MEST)


Thomas,

Why do you call gROOT->Reset in the rootlogon.C file. This erases all definitions of to this point.

After execution of rootlogon.C, ROOT internally resets the "high-water-mark" to the list of objects available at this point such that further gROOT->Reset will not erase previous definitions.

Rene Brun

On Thu,
7
Apr 2005, Thomas Schietinger wrote:

> Hello,
>
> in ROOT 4.02/00 on slc3, I have a problem when using gROOT->Reset();
> in the rootlogon.C script.
> I can do
>
> root [0] gROOT->Reset();
> root [1] cout << "Hello World" << endl;
> Hello World
>
> without problem. But as soon as I move the Reset command into
> my rootlogon.C script, cout is corrupted:
>
> root [0] cout << "Hello World" << endl;
> Error: Symbol cout is not defined in current scope FILE:(tmpfile) LINE:1
> Error: << Illegal operator for pointer 3 FILE:(tmpfile) LINE:1
> Error: << Illegal operator for pointer 3 FILE:(tmpfile) LINE:1
> *** Interpreter error recovered ***
> root [1]
>
> This was produced with the following simple rootlogon.C script:
> tschieti_at_lxplus009_525>cat rootlogon.C
> {
> gROOT->Reset();
> }
>
> A simple workaround is to use printf() instead of cout, but that's
> not a good solution as many pre-existing macros contain cout statments.
>
> Thanks for any help,
>
> Thomas
>
>
Received on Thu Apr 07 2005 - 15:40:27 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:06 MET