Verbose+error+messages

//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 format="bb4w" 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:

code format="bb4w" DEF PROCsave(F$) doing$=" saving """+F$+"""" OSCLI"SAVE "+F$+" "+STR$~mem%+"+100" doing$="" 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:

code Disk full saving "fred" code