QTIPS - Standardising Error Message Display

Published ByDateVersionKnowledge LevelKeywords
Sprezzatura Ltd01 JAN 19922.11+EXPERTMSG, MESSAGE, OSBREAD, OSBWRITE, STATUS, OSERROR, @FILE.ERROR, BFS

Developers keen to apply consistent standards when creating applications have been aided by the introduction of FSMSG which can be used for reporting on all BFS file i/o problems. Unfortunately it does not help when errors are encountered using standard OS functions such as OSBREAD and OSBWRITE which return error status in the STATUS() variable.

An undocumented routine called OSERROR can be used to convert the STATUS() value into a meaningful @FILE.ERROR message suitable for use with FSMSG. The routine takes four parameters as follows

 Call OSERROR ( Unknown , Environment , File, Status )

where Unknown seems not to be used, Environment contains a literal to include in error messages indicating the environment originating the error (E.G. DOS/ MSDOS), File contains the filename to include in the error message and Status contains the error status generated by the i/o action. Sample usage follows

    Osbread Chunk From Os_File At X Length 60000
    If Status() Then
     Status = Status()
     Call Oserror("", "DOS", File, Status)
     Call Fsmsg()
    End

(Volume 3, Issue 8, Page 9)

  • tips/revmedia/v3i8a6.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1