FUNCTION ErrorHandler(nError,cMethod,nLine) LOCAL lcErrorMsg,lcCodeLineMsg WAIT CLEAR lcErrorMsg=MESSAGE()+CHR(13)+CHR(13) lcErrorMsg=lcErrorMsg+"Method: "+cMethod lcCodeLineMsg=MESSAGE(1) IF BETWEEN(nLine,1,10000) AND NOT lcCodeLineMsg="..." lcErrorMsg=lcErrorMsg+CHR(13)+"Line: "+ALLTRIM(STR(nLine)) IF NOT EMPTY(lcCodeLineMsg) lcErrorMsg=lcErrorMsg+CHR(13)+CHR(13)+lcCodeLineMsg ENDIF ENDIF IF MESSAGEBOX(lcErrorMsg,17,_screen.Caption)#1 ON ERROR RETURN .F. ENDIF ENDFUNCThe handler works fine until the program seems to 'lose' the location of the function. An additional hint, I get this message whenever there is an error with Foxfire! inside my program. This is not the only time however. An inescapable loop is pretty frustrating fot the user, and it is embarrasing to have to tell them to ctrl-alt-del to shut down my program. What am I doing wrong with the errorhandling?