User Tools

Site Tools


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. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
verbose_20error_20messages.txt · Last modified: 2024/01/05 00:21 by 127.0.0.1