I cannot understand how that can be related…
History:
I had a bug in my Preferences (Open or Save).
Today was the day to squash it.
So I decided to start by comparing the Save and Open Preferences Methods.
I moved the code of Open to start displaying at the first Write, do the same for the Save and wanted to find an error alterning the views (same monitor).
Too bad, Xojo move the display of the first line of code to the top of the Method !
OK: second guess; I will have to try to remember what I read from one method to the other, and after a while (I was even thinking to write the sequence n a paper shee), I discovered the error (I saved two different colors using only one in two lines… look I do not even explain it correctly !). But the new save was correct.
I run the project and get a crash: apparently a declare I use do not xists in El Capitan. Read the onlne docs, found “IsFunctionAvailable”, add it, run: everything seems OK.
Quit (to write the correct Preferences sequence).
Run and get the Paint Event crash.
OK: left El Capitan, fired the external SSD with High Sierra, fire my Xojo, run and crash:
And now I get a NilObjectException in the Paint Event:
g.DrawRect… !
Left Xojo 2015r1, fire the current version, load the project, run and get the NilObjectExcepton at the same location.
Comment the whole declare block, run: same crash.
Why, the current Xojo IDE window, at open time is so small ?
Time ellapsed.
I read the Prefeerences file, gave smiles to a baby, look around, and when I read my Preferences file contents, noticed a value (the last entry) is way beyond control ! It have to be less that 10. I commented these lines, run… once, twice, thrice…
OK.
Now the question:
The problem lie in the value of a control set of Canvases (the Canvas Member index):
How can I get the number of Canvases in the set ?
With that number, I can add a test and set the value to a defaut if it is out of range…
The DrawRect line that crash draw a rectangle around each Canvas Members, and they are (currently) 5, not thousand(s)…