LPARAMETERS nError, cMethod, nLine local lcmessage, lcvariable lcmessage = message() lcvariable = sys(2018) With THIS .lErrorOccurred = .T. if vartype(.oColError) = "O" then * there is an error collection so fill it in with this error .AddError(nError, cMethod, nLine, lcMessage, lcVariable) else * if no error collection is specified, make the VFP error handler kick in error nError endif Endwith * Following will simply return and attempt to execute the next line after the * one that threw the error. This can be changed by subclassing this class, * issuing a call back to do the error addition in the collection and issuing * a RETURN TO < some procedure here > in the subclass. returnAddError method
lparameters tnError, tcMethod, tnLine, tcMessage, tcVariable local llretval llretval = .T. With THIS if vartype(.oColError) = "O" then * there is an error collection so fill it in with this error local loerror loerror = .oColError.Add() if !isnull(loerror) then * got a valid Error object With loerror .cProgram = tcMethod .nError = tnError .cError = tcmessage .cVariable = tcvariable .nLine = tnLine Endwith loerror = .NULL. endif else * there is no error collection so an error can not be added llretval = .F. endif Endwith return llretval