Error: Non-static-const

From: Roger Mason <rmason_at_esd.mun.ca>
Date: Mon, 14 Nov 2005 16:43:58 -0330


Hello,

I'm trying to put some number entry boxes on a frame, with the number of these boxes being determined by the requirements of the function selected in a combo box. The code below correctly gets nparm = 3 but fails at the arrowed line with the message:

Error: Non-static-const variable in array dimension FILE:Gui.C LINE:59  (cint allows this only in interactive command and special form macro  which
  is special extension. It is not allowed in source code. Please  ignore
  subsequent errors.)


   Int_t nparm = 0;
   if (!strcmp(((TGTextLBEntry *)fComboFuncNames->GetSelectedEntry())->GetTitle(),"Gaussian")) nparm = ngp;

// if (fComboFuncNames->GetTextEntry()=="Lorentzian") nparm = nlp;
// if (fComboFuncNames->GetTextEntry()=="Voigtian") nparm = nvp;
// if (fComboFuncNames->GetTextEntry()=="Background") nparm = 1;

   cout << endl << "debug: TextEntry = " << ((TGTextLBEntry *)fComboFuncNames->GetSelectedEntry())->GetTitle() << endl;    cout << endl << "debug: nparm = " << nparm << endl;

   TGNumberEntry *neParm[nparm];
fails---> for (Int_t i = 0; i < nparm; i++) { // Make number entry boxes

   neParm[i] = new TGNumberEntry(fFuncFrame,1.0,5,i,(TGNumberFormat::EStyle)1);      fFuncFrame->AddFrame(neParm[i], new TGLayoutHints(kLHintsTop | kLHintsLeft,5,5,5,5)); // Add to parent frame    }

I just can't see what is wrong with that line.

Thanks for any help you can give.

Roger Received on Mon Nov 14 2005 - 21:14:06 MET

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