>#Include FoxPro.h >local lcTable >lcTable = "" >lcTable = getfile("Error Table:DBF") >if empty(lcTable) > return >endif >close tables all >use (lcTable) excl alias Errors >local lnRetVal >lnRetVal = MessageBox("Zap table first?", MB_ICONQUESTION + MB_YESNO, "Warning...") >if lnRetVal = IDYES > zap >endif >set order to errnum >on error do SetError >for i = 1 to 5000 > if i = 1116 && Too many window open error which stops execution > insert into Errors ( ErrNum, Descript ) ; > values ( 1116, "Too many windows open." ) > loop > endif > error(i) >endfor >on error >return > > >procedure SetError >* >local array laError[1] >local llInsert >lnRetVal = aerror(laError) >if lnRetVal = 0 > return >endif >llInsert = .t. >if laError[1,1] = 1941 && I do not remember why I put this here > seek 1941 > if not eof() > llInsert = .f. > endif >endif >if llInsert > insert into Errors ( errnum, descript ) ; > values ( laError[1,1], laError[1,2] ) >endif >return >I know why you put 1941 there...it's "Error code is not valid". IOW, it's what's generated when you issue ERROR with a parameter and the error doesn't exist.:-)