Pragma mystery

It issues a warning, which seems to simply be ignored.

The code I posted at the start of this conversation omitted the line

me.refresh

after

Me.Height = (me.listcount +1) * (me.textSize + 2)

and it is the me.refresh which causes the crash. I haven’t the slightest idea why and I apologise for omitting it.

me,refresh IN the cell paint event probably causes a stack overflow.
But you didn’t say what the crash was so I’m guessing.

In your original post… ME.REFRESH is most likely crashing, because the Pragma said you were not using ME
does it still crash after your remove the Pragma?

Just another point:
I use #Pragma Warning "do this or do that ... etc " quite often in my code to have reminders where some work still needs to be done. Very handy.

[quote=218771:@Dave S]In your original post… ME.REFRESH is most likely crashing, because the Pragma said you were not using ME
does it still crash after your remove the Pragma?[/quote]
Dave you don’t get it. He didn’t add those pragmas they were inserted an appear in the debugger.

I guess I don’t get it… since when does XOJO write code for you?

Pragmas don’t “magically” appear… anymore than any other code entries

An example: when you use CurrentMethodName, the compiler inserts something like the following at the top of a method:

[code]Sub Open()
Const CurrentMethodName = “Window1.Open” // Inserted by Xojo compiler

// your code here
End Sub[/code]

Xojo writes a TON of code for you.

[quote=218793:@Dave S]I guess I don’t get it… since when does XOJO write code for you?
[/quote]
It writes a TON of code for you
You draw a layout
It writes ALL the code for that layout to come to life at runtime
The entire “assembling code” when you hit build or run is the IDE writing code for you

Yes, Norman, it was a stack overflow and the pragma lines appeared in the debugger.