If a breakpoint is set then Return of Class is Nil

I occasionally see this. If I set a breakpoint somewhere in the code the return of the class is Nil.

This code is supposed to return the class, but if I set a breakpoint, or just trace the process and enter this method, it returns Nil.
Otherwise it function properly.


[code]//nxtPRow As Integer
//Called to update list And by App.OpenAFile And ClRndAry.FillForRandom
//Default for every user outside is App.TPrfDapt
//ClRndAry has ClRndAry.ScpyDat to not Edit the original
//AddCardWindow has AddCardWindow.AcwRw because it can be new or imported

Dim np As New RowPrfClass()
Dim i As Integer
If nxtPRow > -1 And nxtPRow <= YPUbnd Then
For i = 0 to kPCols
np.dapta(i) = PractFSets(nxtPRow).dapta(i)
np.actve = PractFSets(nxtPRow).actve
np.id = PractFSets(nxtPRow).id
np.isFolder = PractFSets(nxtPRow).isFolder
np.isOpen = PractFSets(nxtPRow).isOpen
np.parent = PractFSets(nxtPRow).parent
End If
Return np

When you step through the code, you must step beyond the return statement to see the return value. Are you doing that?

Yes. Sorry I didn’t include that. I noticed when I was in the calling method, or maybe one above, the return was Nil. I went into this method and np was a complete construction and the Return from the beginning was Nil, but it should have been np.

Also, everything else is in a module and is global.

What version of Xojo are you using? And are you running this program as 32bit or 64bit ?

I’ve seen this on Mac High Sierra and Windows 64 bit. Both are current.
And now I cannot reproduce it.