The top three lines appear when I run the program. Could somebody please explain what they mean? It all worked Ok yesterday as far as I remember …
[code]Function CellBackgroundPaint(g As Graphics, row As Integer, column As Integer) As Boolean #pragma unused me #pragma reset
const CurrentMethodName = “Wnd1.ScoreLB.CellBackgroundPaint”
Me.Height = (me.listcount +1) * (me.textSize + 2) //20
if row < me.listcount then
If row = 0 then
g.foreColor= &cff0000
g.fillrect 0,0,g.width,g.height
Else
select case me.list (row)
case " Pegging stage"
g.forecolor = &cffc200
case " Score the Hands"
g.forecolor = &cffc200
case " Score the Crib (" + gDealerName + “)”
g.forecolor = &cffc200
case " Final Scores"
g.forecolor = &cffc200
case else
g.forecolor = &cc6c6c6
end select
g.fillrect 0,0,g.width,g.height
'return true
end if[/code]
I bet he saw this in the debugger and not his actual code. Sometimes it’s possible to make a function break on the header, usually because of a stack over flow, and this makes the hidden lines added by the compiler visible, such as the current method name constant. I’ve only seen this a couple times on iOS projects though, and it seems random as to whether it happens or not as far as I can see so I’ve never filed a bug report.
#pragma unused me // this is a legit pragma I use it all the time as described above #pragma reset // never seen this one… so it might be the source of the OP issue
#pragma reset makes perfect sense, given that pragmas do not follow function calls. That would be the internal mechanism they must use to clear all the pragmas for the newly called method. If Jason is correct, then the real question becomes, What caused the crash in the OP’s code, and is THAT something that the OP can fix, or is that some internal Xojo error?
Was there any indication of an Exception? If you (the OP) press Resume, do you get an Unhandled Exception event or message box?