User Tools

Site Tools


verbose_20error_20messages

This is an old revision of the document!


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.1522502391.txt.gz · Last modified: 2018/03/31 13:19 by 127.0.0.1