What is the error?

A long time ago in a version far away there was a demo program released with RealBasic called Shisen-Sho. I hav been updating it version by version to keep it running, but I am now stymied. I am getting an error when compiling that is not “defined” in that I cannot tell what the error is and Xojo will not tell me what the problem is. The code stops compiling and I see a little bug but no listing of what the bug is.

As seen in the screenshot: https://www.dropbox.com/s/5yo82tl83t0wydx/Unknown%20Error.png?dl=0

Help?

Here is what I have: https://www.dropbox.com/s/em8zh1c2cfdbsw7/Shisen-Sho%20Catalina%20B.xojo_binary_project?dl=0

You never instantiate playField.

Hmmm, I thought that line instantiated playField.

Also, this code has been running for decades. Where/how would I instantiate it now?

You defined a property for it, but there is nowhere that you instantiate a picture to store in the property. That’s why you get a NilObjectException, the playField property is nil when you go to fill it.

Where and how you instantiate it depends on how you want to engineer your software. At some point prior to FillRectangle, you will need playField = new Picture(xx, xx)

1 Like

was the playField a Canvas before where you could paint direct into graphics maybe?
Today Canvas allow paint only in Paint Event where you get g as Graphics parameter.
you could paint into a picture and then g.DrawPicture
or just call Canvas1.invalidate and then in paint event do the drawings.