Re: [ROOT] continue statement in interpreted code??

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Aug 17 2001 - 08:00:29 MEST


Mike,
I cannot reproduce this problem. Can somebody reproduce it running
the script below? If yes, please indicate on which system/version.

Rene Brun

void test_bug(){
        TH1F *h1 = new TH1F("h1", "h1", 100, 1, 100);
        TH1F *h2 = new TH1F("h2", "h2", 100, 100, 200);
        TCanvas *can = new TCanvas("can", "can", 600, 800);
        can->Divide(1,2);
        can->cd(1);
        TPad *pad1 = (TPad*)gPad;
        h1->Draw();
        can->cd(2);
        TPad *pad2 = (TPad*)gPad;
        h2->Draw();
        Double_t result = 0;
        Int_t i = 0;
        while(i<1000){
                result = gRandom->Gaus(50, 5);
                if(result < 50){
                        i++;
                        continue;
                }
                h1->Fill(result);
                h2->Fill(result*2);
                if(i%10 == 0){
                        pad1->Modified();
                        pad2->Modified();
                        can->Update();
                }
                i++;
        }
}


On Thu, 16 Aug 2001, Mike Kordosky wrote:

> Hi Rene,
> 
> There was a "bug" in my bug report!  The macro works if you comment out
> the body of the statement:
> 
>                 if(result < 50){
>                       i++;
>                       continue;
>                 }
> eg:
> 
>                 if(result < 50){
> //                      i++;
> //                      continue;
>                 }
> 
> 
> 
> Sorry about that!
> 
> Mike Kordosky
> 
> -- 
> Graduate Research Assistant  // High Energy Physics Lab
> kordosky@hep.utexas.edu     // University of Texas at Austin
> kordosky@fnal.gov	   //
> ph: (512) 471-8426 (RLM Lab, Office)
>     (512) 475-8673 (ENS Lab)
> 



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:57 MET