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

From: Otto.Schaile@Physik.uni-muenchen.de
Date: Fri Aug 17 2001 - 10:08:01 MEST


Hi,
I reported this problem some time ago (17 Jul 2001):
-------------------------------------------------------------
may be this is for Masa:
we work with 3.01/05  Linux egcs-2.91.66
this macro worked with 2.25/03:

{
   char a[10];
   for (int i=0; i<3; i++){
      if(i == 0) continue;
      istrstream is(" aa bb cc ");
      is >> a;
      cout << "a: " << a << endl;
   }
}

The problem is the line with "continue", without
this it works.
-------------------------------------------------------------

Masa said he would fix it.

Cheers
Otto


On Fri, 17 Aug 2001, Rene Brun wrote:

> 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)
> > 
> 

Otto Schaile            Sektion Physik, LMU Muenchen
Phone: +49 89 289 14070     Am Coulombwall 1, D-85748 Garching, Germany
GSM:   +49 160 1553598
FAX:   +49 89 289 14072     EMail: Otto.Schaile@Physik.Uni-Muenchen.DE



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