Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is there any way to programatically avoid the FoxPro error - "Structur

Status
Not open for further replies.

Goofus828

Programmer
Nov 9, 2005
127
US
is there any way to programatically avoid the FoxPro error - "Structural CDX file not found" with the Cancel and Ignore Prompts?


This is not because the cdx is missing but because it damaged.

I've tried Stuffing the Keyboard with "I" to ignore so that I can rebuild the CDX.

Any help would be appreciated.

Thanks.
 
There are many error handling examples on this forum.
But here some code to start with:

Somewhere in the begin of your main program:

on error do MyErrorRoutine with error()


In MyErrorRoutine.prg
parameters lnError
do case
case 1 && file does not exist
* here what you want to do
case 13 && Alias not found
* here what you want to do
** and all other cases you want to handle
case 1707 && structural index file not found
* here what you want to do
endcase
return
 
And off course the MyErrorRoutine.prg should look this way:

In MyErrorRoutine.prg
parameters lnError
do case
case lnError-1 && file does not exist
* here what you want to do
case lnError-13 && Alias not found
* here what you want to do
** and all other cases you want to handle
case lnError-1707 && structural index file not found
* here what you want to do
endcase
return
 
Well the typo's seem to hount me today...

this is the correct one.

In MyErrorRoutine.prg
parameters lnError
do case
case lnError=1 && file does not exist
* here what you want to do
case lnError=13 && Alias not found
* here what you want to do
** and all other cases you want to handle
case lnError=1707 && structural index file not found
* here what you want to do
endcase
return
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top