InOutRes is documented as read-only, but it isn't and also isn't meant to be read-only
Original Reporter info from Mantis: Thaddy
-
Reporter name: Thaddy de Koning
Original Reporter info from Mantis: Thaddy
- Reporter name: Thaddy de Koning
Description:
InOutRes is documented as read-only, but it isn't and also isn't meant to be read-only!
https://www.freepascal.org/docs-html/rtl/system/inoutres.html
InOutRes is even used in the RTL as writeable (107)
Ranges above 255 may be considered usermode errors? (not sure)
Errors are linked to categories:
type
DosErrors = 2..99;
IOErrors = 100..149;
FatalErrors = 150 ..199;
CompilerErrors = 200..255;
CustomErrors = 256..High(word);
Steps to reproduce:
program testInOutRes;
{$I-}
var
s:string = ' FreePascal';
begin
if s = ' Einstein' then
InOutRes := $dead; // a free slot above 1000
writeln(IOResult,s);
end.
Additional information:
This has always been writeable and I have seen and used it in production code.
It is the old man's equivalent of manual Raise....
Mantis conversion info:
- Mantis ID: 36122
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 1662 (#f0e7f6fa)
- Target version: 3.2.0