I have a standalone application that draws a few canvases, and during initialization I execute (via gSystem->ProcessLine(".x .rootstart.C") ) the following lines as part of a stylesheet in order to set the palette:
Every now and then, I get the following error message: Error: Too many initializers, exceeded length of array for ‘stops’ .rootstart.C:48:
*** Interpreter error recovered ***
By every now and then, I mean maybe once every 3-4 times I execute the program. I’m utterly baffled as to why it only complains sometimes! I should also note I call the exact same stylesheet from my .rootrc and have never seen the error.
I tried the code you sent in an interpreted macro and in compiled code using the latest ROOT version on Mac and I do not see the problem you are describing here.
Can you reproduce it with a small macro we could run with the ROOT interpreter ?
Hmm. I’m also unable to reproduce with the interactive environement. I also can’t reproduce it with a trivial standalone executable.
If I can manage to reproduce it with something less than the entire enormous project that it’s in now I’ll post it; otherwise I guess there’s not much else that can be done at the moment.
I just found this post as I had the same error message coming up, … and I found a solution so thought I’d post it for anyone else with the same problem.
I was defining a palette in a compiled macro to draw my histogram. This palette had 5 stops. However, I had forgotten that I already defined a palette in my rootlogon.C with only 4 stops.
Commenting out the one in rootlogon.C (and restarting my terminal window) fixed the problem.