Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
On error
Message
De
26/02/2007 10:16:54
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01198769
Message ID:
01198775
Vues:
15
This message has been marked as the solution to the initial question of the thread.
>If I wrote
>
>on error 1881 = messagebox ("bad data")

this one is a logical expression so it compare 1881 with the result of messagebox.. it will result always .f.
>
>it works OK, but if I wrote
>
>on error 1881 do form error1
>
>It gives sintax error
>
>What can be wrong ?

try:

m.tipe_err = 1 && serious one
m.tipe_err = 2 && not so serious
m.tipe_err = 3 && just warning

On ERROR DO errorhandler WITH MESSAGE(), ERROR(), LINENO(), m.tipe_err, PROGRAM()
Function errorhandler
    Parameters m.messg, m.error_no, m.lineno, m.code, m.programid
    #if  version(2)=2
         SET STEP ON
    #endif
    If  m.error_no = 1881
        do form error1
        Return
    Endif
HTH
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform