>SELECT regtrans >USE >ERASE .\DBF\REGTRANS.CDX > >SELECT 0 >USE REGTRANS EXCLUSIVE >PACK >>
PROCEDURE POSERROR PARAMETERS eProg, eERROR, eMESSAGE, eMESSAGE1, eLINENO LIST MEMO TO ERROR.FLE NOCONSOLE LIST STATUS TO STATUS.FLE NOCONSOLE eFile = ALIAS() SELECT 0 USE POSERROR APPEND BLANK REPLACE DATE WITH DATE(),; TIME WITH TIME(),; PROGRAM WITH ePROG,; ERROR WITH eERROR,; LINENO WITH eLINENO,; MESSAGE WITH eMESSAGE,; MESSAGE1 WITH eMESSAGE1 USE IF NOT EMPTY(eFile) SELECT (eFile) ENDIF ON ERROR RETRYbut the error occurs when I run the code from ANOTHER startup program (a NEW one), that calls the offending code from a FORM called FRMNIGHT which has an ERROR event !!!
LPARAMETERS nError, cMethod, nLine IF nError = 1 WAIT WINDOW "Error is Files does not exist" nowait WAIT clear ENDIFSo, is the ERROR event overriding the ON ERROR procedure, and making it where the automatic resolving of the link is done impossible?
3.Use an ON ERROR statement to trap the structural .CDX file error. With the code below, FoxPro can automatically remove the reference without displaying an error message. SET SAFETY ON && Enable file protection. USE customer && Open a DBF file. INDEX ON city TAG city ADDITIVE && Create structural CDX file. CLOSE ALL && Close all files. DELETE FILE customer.cdx && Remove CDX file. ON ERROR WAIT WINDOW "REMOVING REFERENCE AUTOMATICALLY" NOWAIT *** Trap the error and print a message USE customer *** Invoke the ON ERROR routine to automatically remove the *** reference. WAIT WINDOW "OK to issue USE <file> now !" NOWAIT ON ERROR *** release the ON ERROR statement NOTE: FoxPro does not open any files after the ON ERROR statement removes the reference. The user must issue the USE <file> command again to access the information in the .DBF file.