Re: [ROOT] Global variable scope question

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Aug 21 2002 - 15:13:27 MEST


Hi Ed,

If you define a global variable with CINT (eg float R2), this variable
must be visible in any interpreted function.
My guess is that you are calling "gROOT->Reset()" somewhere
in your selector.

A CINT global variable cannot be seen from the compiled code
if it is not declared to CINT as well (like we do for globals
like gFile, gDirectory,etc).

Rene Brun

On Tue, 20 Aug 2002, Edward Chen wrote:

> Hi - I have a global variable which shows up when I do .g:
> 
> 
>                  11 0x8733bf0  Float_t R2=0
> 
> 
> I want to access the value of R2 in TSelector::ProcessCut().  Is that
> possible?  I'm getting the following error message:
> 
> 
> /data1/babar/edward/root/temp.C:67: `R2' undeclared (first use this
> function)
> 
> Thanks.  (I'm using ROOT 3.03/06)
> 
> -Ed
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:05 MET