>Could you give a more detailed example of where you put the code to trap for this error?
>
>thanks
I've posted it although I've seen someone else's code in this thread which is very similar.
Again, it's before the form is opened rather than in the DE, even though the debugger and whatnot report that the error lies in the DE. (Clearmsg and StatusMsg are calls to wait window x nowait and wait clear respectively). The solution seems to be to have the error handling in the routine itself rather than calling another routine: this code is from a class - if the error handler is outside the routine (even if it's in the class) the push/pop problem occurs. I've had the push/pop error for other errors too, now I come to think of it, and it seems to be related to leaping out of certain classes.
local oldEHandler, e, nRetries, nMaxTries,m
nMaxTries = 6
oldEhandler = on("error")
e = 0
nRetries = 0
=rand(-1)
on error e = error()
DO FORM (lcFileName) NAME this.aForms[this.nFormCount] LINKED NOSHOW
do while ((e <> 0) and (nRetries < nMaxTries))
m = str(e) + " - Retrying: " + alltrim(str(nRetries)) + " of " + alltrim(str(nMaxtries))
nRetries = nRetries + 1
doevents
statusMsg(m)
=inkey(.2+rand())
e = 0
DO FORM (lcFileName) NAME this.aForms[this.nFormCount] LINKED NOSHOW
enddo
clearMsg()
on error &oldEHandler