User Tools

Site Tools


Command disabled: register
verbose_20error_20messages

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:

        doing$="":ON ERROR REPORT:PRINTdoing$:doing$=""

will display the contents of doing$ after the error message. If you then use code along the following lines:

        DEF PROCsave(F$)
        doing$=" saving """+F$+""""
        OSCLI"SAVE "+F$+" "+STR$~mem%+"+100"
        doing$=""
        ENDPROC

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"
This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information
verbose_20error_20messages.txt · Last modified: 2018/04/17 19:25 by tbest3112