Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Startup Program
Message
From
28/01/2005 03:29:52
Jon Neale
Bond International Software
Wootton Bassett, United Kingdom
 
 
To
27/01/2005 14:42:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP
Network:
Novell 4.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00981133
Message ID:
00981621
Views:
41
Hi,

This is what I use. To be honest I have been meaning to improve the error handling in this product for ages but never get the time.

PROCEDURE Soluserror
PARAMETERS p_ERROR, p_MESSAGE, p_MESSAGE1, p_PROGRAM, p_LINENO

LOCAL lcerror,w_msg1,w_msg2

=AERROR(w_aerror)
lcerror = iWord(ON("ERROR"), 2)

*DO &lcerror WITH nError, w_aerror[1,2], "", cMethod, nLine
w_msg1 = "An error has occurred. Please report the following error to Infosupport. " + CHR(13)
w_msg2 = "Error " + LTRIM(STR(ERROR())) + CHR(13)+ ;
"Message() " + MESSAGE() + CHR(13) + ;
"Message(1) " + MESSAGE(1) + CHR(13) + ;
"SYS(2018) " + SYS(2018) + CHR(13) + ;
"Program " + ALLTRIM(UPPER(p_program)) + CHR(13) + ;
"Line Number " + ALLTRIM(STR(p_lineno))
IF MESSAGEBOX(w_msg1+w_msg2,21,"Application Error" ) = 2
* cancel pressed quit
QUIT
ENDIF
IF x_fpwrun()
SUSPEND
ENDIF

RETURN
*
*
*

HTH

Jon





>Hi Jon
>
>I noticed an error procedure in you startup code :
>ON ERROR DO soluserror WITH ERROR(), MESSAGE(), MESSAGE(1), PROGRAM(), LINENO()
>
>Is it possible to get your error procedure please. My startup has no error trapping facilities at all.
>Thanks
>Shafid
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform