Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Onerror as part of an exe
Message
 
À
11/09/2003 00:46:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00828061
Message ID:
00828273
Vues:
13
>Hi. Running VFP7. Will an 'onerror' routine work in an executable?
>Thanks, Randy

Just to follow up on Nadya and Sergey:
* At top of executable or Main PRG
ON ERROR DO errhand WITH ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )

* Anywhere you store procedures:
PROCEDURE errhand (merror, mess, mess1, mprog, mlineno) &&----------
on error
if messagebox('Error number           :'+LTRIM(STR(merror))+chr(13);
              +'Error message          :'+ mess+chr(13);
              +'Line of code with error:'+mess1+chr(13);
              +'Line number of error   :'+LTRIM(STR(mlineno))+chr(13);
              +'Alias                  :'+alias()+chr(13);
              +'Order()                :'+Order()+chr(13);
              +'Program with error     :'+mprog,1+48,[Error Trapped!])=2
   CANCEL
else
   ON ERROR DO errhand WITH ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ),INENO( )
endif
ENDPROC && errhand
Imagination is more important than knowledge
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform