Ticket #213 (Fixed)Tue Jul 21 15:00:18 UTC 2009
TextGadgets module uses OS/BBC-compatible error no. 0 (clashes with BASIC).
Reported by: | Christopher Bazley (288) | Severity: | Minor |
Part: | RISC OS: Module | Release: | |
Milestone: | Status | Fixed |
Details by Christopher Bazley (288):
Many of the OS error blocks that may be returned by the TextGadgets module use a nominal error number of 0, instead of a proper error number from an allocated chunk.
This is very bad practice because error 0 is one of a block of 256 error numbers allocated for operating system / BBC-compatible errors. According to the BBC BASIC manual, it can have the following meanings:
Corruption of stack Error control status not found on stack for RESTORE ERROR HELP has no information on this keyword Incorrect in-core file description Invalid LISTO option Invalid TWINO option Line too long Line numbers larger than 65279 would be generated by this renumber LIST/TWIN found line number reference Missing incore name No room No room to do this renumber StoppedAn unwelcome consequence is that if SYS “Toolbox_ObjectMiscOp” generates error 0 then BASIC does not call any error handlers set up by the program. Therefore, an application written in BASIC may bomb out and lose all the user’s data if it uses Toolbox methods provided by the TextGadgets module.
This is demonstrated by the following BASIC program, which does not print “Handling error, Fish!” as might be expected:
ON ERROR: ON ERROR OFF: PRINT "Handling error “;ERR;”, ";REPORT$:END DIM block% 256 !block% = 0 $(block%4)= “Fish!”CHR$0 SYS “OS_GenerateError”,block%Changelog:
Modified by Sprow (202) Sun, February 28 2010 - 10:44:21 GMT
- Status changed from Open to Fixed
Hopefully fixed in Gadgets 0.31.