Thanks Klaus!
clsDrawPics is the class, the codeline is in.
Strange: I paused working on that app, shut down the pc. Now where I am back and started everything from scratch, no more error in this line!
Really interesting to experience the surprises of b4a!
Edit: I now found out, how to reproduce this error. Normally I declare my classes just once in Starter as public and initialize them there, because the initialize-routine sometimes takes much time (loading values, calculating stuff...). When I need the class elsewhere, I set a reference to the starter-instance:
In Starter:
Sub Service_Create
clsDraws.Initialize 'is public
clsGlobVars.Initialize
...
in this case, I need the class clsDraws in another class (clsHeader), so there in Initialize I wrote:
Public Sub Initialize(PnlBasis As Panel, AName As String)
draws=Starter.clsDraws 'draws is private in Class_Globals
Log("Draws is initialized: " & draws.IsInitialized) 'shows true
'draws.Initialize
when I now call a sub in class clsDraws from clsHeader like:
bmp=draws.drawGrindEdge(0,0,gv.LastAngle,0,False,False,True,True,False,False)
the above error occurs within class clsDraws.
If I do not set the class clsDraws as reference in class clsHeader but initialize it there (swap the comments in sub Initialize), this error does not arise.
Is my way of doing it wrong, or is it a bug?