Thank you! Let's see, what did I learn. Retry, never saw it in 20 years. And testing for a specific error code with error() allows me to create custom error solutions in my one error procedure.

FP/DOS lives for a few more years,

John






On 11/06/2014 07:42 PM, Dan Covill wrote:
John:
The exact same code is in my FP 2.6 DOS version of ErrTrap, which was last 
modified in 2000.  So it will work.  The 'retry' is what exits the ErrTrap with 
the DBF open, without the (missing) CDX.
If you don't have a generic ErrTrap procedure, you could just do          on 
error do CheckCdx             while opening the DBF's and then put it back.

Dan

Date: Thu, 6 Nov 2014 17:19:59 -0800
From: jsow...@americansentry.net
To: profoxt...@leafe.com
Subject: Re: Problem with Missing CDX

I like the trap the error message routine.  I found the sys(2018)
function.  I am concerned though re: when the error occurs vs. when it
is trapped.

I am running v2.6/DOS.  I have a standard error routine that even lets
me know when I come to work in the morning that an error occurred and
more info than I will need to fix it, but that is a fatal error.

Can I trap for the event, knowing that it might happen, without letting
it happen.  It sounds like errortrap is a vfp function.  I tried vfp
5.0, it never ran, and by the time the next version came out I had moved
to Linux for my gui os.  I run 2.6/DOS either in DOS or Linux/dosemu.

John



On 11/06/2014 03:16 PM, Dan Covill wrote:
John Sowden:   Re-formatting this msg per Tracy Pearson's suggestion:

We solved this same problem with the following code in our ErrorTrap procedure:if error() 
= 1707 or upper(message(1)) = "STRUCTURAL CDX FILE NOT FOUND."
     *-- ignore it, because our programs will build the index.
     retry                     && which will open the file
endif
When you do 'use MyDBF' it triggers the error because the CDX is missing.  This 
code ignoresthis particular error and opens the DBF without the CDX.  You can 
then test for the CDXand do your re-creation.
Dan Covill                                      

--- StripMime Report -- processed MIME parts ---
multipart/alternative
    text/plain (text body -- kept)
    text/html
---

[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/545c776b.2070...@americansentry.net
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to