View Issue Details

IDProjectCategoryView StatusLast Update
0036122FPCDocumentationpublic2019-10-01 20:19
ReporterThaddy de KoningAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.3.1Product Build 
Target VersionFixed in Version3.3.1 
Summary0036122: InOutRes is documented as read-only, but it isn't and also isn't meant to be read-only
DescriptionInOutRes 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 Reproduceprogram testInOutRes;
{$I-}
var
  s:string = ' FreePascal';
begin
  if s = ' Einstein' then
    InOutRes := $dead; // a free slot above 1000
  writeln(IOResult,s);
end.
Additional InformationThis has always been writeable and I have seen and used it in production code.
It is the old man's equivalent of manual Raise....
TagsNo tags attached.
Fixed in Revision1662
FPCOldBugId
FPCTarget3.2.0
Attached Files

Activities

Thaddy de Koning

2019-09-30 21:55

reporter   ~0118222

It may be that the old size was once byte, not word, not sure.

Bart Broersma

2019-09-30 22:12

reporter   ~0118223

@Thaddy. From TP help: system constants: InOutRes: Integer = 0;

Thaddy de Koning

2019-10-01 08:25

reporter   ~0118225

Last edited: 2019-10-01 08:38

View 5 revisions

Yes, but even in TP writeable! (Has always been so)
That is by necessity of course, otherwise it can not be set to an error condition. ;) ....
We used it in the famous - in the Netherlands - PerfectView (written in TP) to set our own error types.

But the 16 bit integer type makes sense given the current word type if that is what you mean.

Thaddy de Koning

2019-10-01 08:44

reporter   ~0118226

Last edited: 2019-10-01 08:47

View 3 revisions

Example regarding PerfectView (1.000.000+ licensed software):
Database errors were classified as any of the above qualifications and categories except the compiler errors.
I am not sure we used ranges or simply design restriction for that. Long time ago.

Michael Van Canneyt

2019-10-01 20:19

administrator   ~0118238

Added some clarifying notes. Outside of routines that implement file I/O, it is not meant to be written to.

Issue History

Date Modified Username Field Change
2019-09-30 21:53 Thaddy de Koning New Issue
2019-09-30 21:53 Thaddy de Koning Status new => assigned
2019-09-30 21:53 Thaddy de Koning Assigned To => Michael Van Canneyt
2019-09-30 21:55 Thaddy de Koning Note Added: 0118222
2019-09-30 22:12 Bart Broersma Note Added: 0118223
2019-10-01 08:25 Thaddy de Koning Note Added: 0118225
2019-10-01 08:27 Thaddy de Koning Note Edited: 0118225 View Revisions
2019-10-01 08:32 Thaddy de Koning Note Edited: 0118225 View Revisions
2019-10-01 08:38 Thaddy de Koning Note Edited: 0118225 View Revisions
2019-10-01 08:38 Thaddy de Koning Note Edited: 0118225 View Revisions
2019-10-01 08:44 Thaddy de Koning Note Added: 0118226
2019-10-01 08:45 Thaddy de Koning Note Edited: 0118226 View Revisions
2019-10-01 08:47 Thaddy de Koning Note Edited: 0118226 View Revisions
2019-10-01 20:19 Michael Van Canneyt Status assigned => resolved
2019-10-01 20:19 Michael Van Canneyt Resolution open => fixed
2019-10-01 20:19 Michael Van Canneyt Fixed in Version => 3.3.1
2019-10-01 20:19 Michael Van Canneyt Fixed in Revision => 1662
2019-10-01 20:19 Michael Van Canneyt FPCTarget => 3.2.0
2019-10-01 20:19 Michael Van Canneyt Note Added: 0118238