QTIPS - Standardising Error Message Display
Published By | Date | Version | Knowledge Level | Keywords |
---|---|---|---|---|
Sprezzatura Ltd | 01 JAN 1992 | 2.11+ | EXPERT | MSG, 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)