User Tools

Site Tools


verbose_20error_20messages

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
verbose_20error_20messages [2018/03/31 13:19] – external edit 127.0.0.1verbose_20error_20messages [2024/01/05 00:21] (current) – external edit 127.0.0.1
Line 2: Line 2:
  
 //By J.G.Harston, July 2009//\\  The **REPORT** command reports the last program error. It can make error messages more informative if you also display a message telling the user what action caused the error. A simple way to do this is to set and clear a variable around actions, and display this message as part of the error handler. For instance, the following error handler:\\ \\  //By J.G.Harston, July 2009//\\  The **REPORT** command reports the last program error. It can make error messages more informative if you also display a message telling the user what action caused the error. A simple way to do this is to set and clear a variable around actions, and display this message as part of the error handler. For instance, the following error handler:\\ \\ 
 +<code bb4w>
         doing$="":ON ERROR REPORT:PRINTdoing$:doing$=""         doing$="":ON ERROR REPORT:PRINTdoing$:doing$=""
 +</code>
 will display the contents of **doing$** after the error message. If you then use code along the following lines:\\ \\  will display the contents of **doing$** after the error message. If you then use code along the following lines:\\ \\ 
 +<code bb4w>
         DEF PROCsave(F$)         DEF PROCsave(F$)
         doing$=" saving """+F$+""""         doing$=" saving """+F$+""""
Line 9: Line 12:
         doing$=""         doing$=""
         ENDPROC         ENDPROC
 +</code>
 then if that code generates an error (eg Bad filename, Disk full, etc), then the displayed error message will be of the form:\\ \\  then if that code generates an error (eg Bad filename, Disk full, etc), then the displayed error message will be of the form:\\ \\ 
       Disk full saving "fred"       Disk full saving "fred"
verbose_20error_20messages.1522502391.txt.gz · Last modified: 2024/01/05 00:16 (external edit)