This topic describes how to record compiling errors when using FlashBASIC. Errors encountered during runtime are logged to the DM,RUNTIME-ERRORS file. These errors can be displayed by using the TCL command LIST-RUNTIME-ERRORS
When compiling FlashBASIC programs with the o option, the compiler automatically logs all compilation errors if a data section called $log is present in the user's BASIC program file. The log is updated only when errors occur. Each log entry's ID is the same as the ID of the item being compiled.
The first attribute of the entry consists of the time and date that the error occurred as well as the phase of compilation where the error occurred. Other attributes can contain additional undefined information can contain UNIX error messages.
For UNIX: Not supported
For Windows: FlashBASIC runtime errors can be logged to the Windows event log. This feature is set from the FlashBASIC tab of the D3 Device Manager. See the D3 System Administration Guide for more information.
A Windows event log entry has the following format:
Runtime error <err> @ <progname>:<lineno>
|FlashBASIC error message item-ID.
|Item-ID of the FlashBASIC module.
|Source line number.
Additional information can also be logged in the Data section of the Windows event log (accessible through the Event Detail dialog box in the Windows event viewer). For example:
Runtime error B12 @ myprog :15
B12 is a file has not been opened error, occurring in module myprog at line 15.
To enable logging for a file called bp, type:
create-file bp,$log 7
Compiling using the o option now logs errors into the bp,$log file. These can be displayed by typing any of these commands:
ct bp,$log list-item bp,$log sort-item bp,$log