Re: problem with a Boolean

From: Christoph Borgmeier (borg@mail.desy.de)
Date: Tue Mar 07 2000 - 12:00:53 MET


On 6 Mar 2000, Thomas Eberl wrote:

[...]
> the boolean variable kRichCal to 1 (kTRUE). If I set it to 0 (kFALSE),
> it should only loop and in particular it should not see the following
> line:
> 
> nBytesRichCal += bRichCalNrLeaves -> GetEntry(i);
> 
> Instead, what happens is that it says the following:
> 
> >>Error: non class,struct,union object $bRichCalNrLeaves used with . or -> >>FILE:/share/home/teberl/hydra/v401/macros/Rich/testBoolean.C LINE:38
> >>Error: Binary operator oprand missing >>FILE:/share/home/teberl/hydra/v401/macros/Rich/testBoolean.C LINE:38
> 
[...]
> kRichCal       = 0; 
>  
> if (kRichCal){
> 
>       Int_t nRichCalData; 
>       TBranch *bRichCalNrLeaves;
>       bRichCalNrLeaves = T->GetBranch("HRichCal.fData_"); 
>       bRichCalNrLeaves -> SetAddress(&nRichCalData);  
>       
> }   
> 
> 
> if(kRichCal)       Int_t nBytesRichCal       = 0; // Byte counter
> 
> timer.Start(); //  performance
> 
> for (Int_t i=nMinEntry; i<nMaxEntry; i++){ // event loop
> 
>      if(kRichCal){
>        nBytesRichCal += bRichCalNrLeaves -> GetEntry(i); 
>            } 
> 
> } // *** end of event loop
[...]

bRichCalNrLeaves is not declared in the scope of the offending line,
regardless of the value of kRichCal. The CINT error message does not seem
to be wrong. In my opinion, the problem is the missing error message in
case kRichCal==true.

Christoph



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:21 MET