displaying_20program_20errors_20in_20a_20message_20box
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
displaying_20program_20errors_20in_20a_20message_20box [2018/03/31 13:19] – external edit 127.0.0.1 | displaying_20program_20errors_20in_20a_20message_20box [2024/01/05 00:22] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 2: | Line 2: | ||
//by Jon Ripley, July 2006//\\ \\ To display a program error in a message box use code similar to the following: | //by Jon Ripley, July 2006//\\ \\ To display a program error in a message box use code similar to the following: | ||
+ | <code bb4w> | ||
ON ERROR SYS " | ON ERROR SYS " | ||
+ | </ | ||
\\ If you replace "" | \\ If you replace "" | ||
+ | <code bb4w> | ||
ON ERROR SYS " | ON ERROR SYS " | ||
+ | </ | ||
\\ For more complex error reporting or if you have a dedicated error handler you can place the above code in a procedure. To do this use code similar to the following at the start of your program: | \\ For more complex error reporting or if you have a dedicated error handler you can place the above code in a procedure. To do this use code similar to the following at the start of your program: | ||
+ | <code bb4w> | ||
ON ERROR PROC_reporterror: | ON ERROR PROC_reporterror: | ||
+ | </ | ||
Here we call **PROC_reporterror** and terminate the program.\\ \\ For unreleased programs use code similar to the following: | Here we call **PROC_reporterror** and terminate the program.\\ \\ For unreleased programs use code similar to the following: | ||
+ | <code bb4w> | ||
DEF PROC_reporterror | DEF PROC_reporterror | ||
SYS " | SYS " | ||
ENDPROC | ENDPROC | ||
+ | </ | ||
\\ For released programs, it is often wise to give users more information with error reports. Asking the user to contact you with sufficient information for you to correct the error is a good idea.\\ \\ To do this use code similar to the following: | \\ For released programs, it is often wise to give users more information with error reports. Asking the user to contact you with sufficient information for you to correct the error is a good idea.\\ \\ To do this use code similar to the following: | ||
+ | <code bb4w> | ||
DEF PROC_reporterror | DEF PROC_reporterror | ||
LOCAL msg$, @% | LOCAL msg$, @% | ||
Line 21: | Line 30: | ||
\ "An error has occurred", | \ "An error has occurred", | ||
ENDPROC | ENDPROC | ||
+ | </ | ||
Change the text of the error report to suit your needs; for instance, you might want to include a contact email address. | Change the text of the error report to suit your needs; for instance, you might want to include a contact email address. |
displaying_20program_20errors_20in_20a_20message_20box.1522502357.txt.gz · Last modified: 2024/01/05 00:18 (external edit)