Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Onerror as part of an exe
Message
 
To
11/09/2003 00:46:04
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00828061
Message ID:
00828273
Views:
14
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform