Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding duplicate keys
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00176022
Message ID:
00176081
Vues:
25
>I guess I'm not clear on error trapping. Do I do something like this:
>
>ON ERROR llNotSaved = .T.
>TABLEUPDATE()
>IF llNotSaved
>*Error message
>ON ERROR

I think I'd rather write it as:
lnError = 0
lcOldError = ON("ERROR")
ON ERROR lnError = ERROR()
TABLEUPDATE()
IF lnError != 0
    DO CASE
        CASE lnError = ...
            WAIT WINDOW "Duplicate value found"
        CASE lnError = ...
            WAIT WINDOW "Could not update record"
        OTHERWISE
            WAIT WINDOW "Unexpected error of type " + ALLTRIM(STR(lnError)) + " detected"
    ENDcase
ENDif
ON ERROR &lcOldError
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform