LPARAMETERS tWhen, cWhere, nLine LOCAL aErrorInfo[1] AERROR(aErrorInfo) * Log the data, including the call stack, into the * ONERROR table. Also, construct a message to the user. LOCAL cStackInfo, nStackLevels, aStackData[1], nStackLevel cStackInfo = "" nStackLevels = ASTACKINFO(aStackData) FOR nStackLevel = 1 TO m.nStackLevels cStackInfo = m.cStackInfo + ; " Level: " + TRANSFORM(aStackData[m.nStackLevel, 1]) + CHR(13) + CHR(10) + ; " File: " + aStackData[m.nStackLevel, 2] + CHR(13) + CHR(10) + ; " Module/Object: " + aStackData[m.nStackLevel, 3] + CHR(13) + CHR(10) + ; " Line: " + TRANSFORM(aStackData[m.nStackLevel, 5]) + ; ": " + aStackData[m.nStackLevel, 6] + CHR(13) + CHR(10) ENDFOR LOCAL cOldSafety, cMemFile, cStatFile cOldSafety = SET("Safety") SET SAFETY OFF cMemFile = FORCEPATH("ListMemo.txt", SYS(2023)) LIST MEMORY TO (m.cMemFile) NOCONSOLE cStatFile = FORCEPATH("ListStatus.txt", SYS(2023)) LIST STATUS TO (m.cStatFile) NOCONSOLE SET SAFETY &cOldSafetyThe one twist here is that this application is working with a bunch of VFP-based COM objects. They get instantiated pretty early, and in fact, I've seen at least one case where I can put an error in after that and I don't get the buffer overrun.