[Oberon] Newlines and Carriage-Returns

Chris Burrows chris at cfbsoftware.com
Mon Jan 7 11:35:52 CET 2019


> 
> On Sat, Jan 5, 2019 at 12:52 PM Andreas Pirklbauer
> <andreas_pirklbauer at yahoo.com> wrote:
> 
> For procedure Texts.Scan it is actually slightly better to use the
> following code for the WHILE loop instead:
> 
>      WHILE ~S.eot & (ch <= " ") DO
> 
> Reason: This code will *not* hang the system if an EOT is encountered
> in the file before any of the characters in the WHILE condition.. for
> example with a file which consists *just* of an EOT.
> 
> This  bug  was already fixed at one point at www.projectoberon.com,
> but now the old version is back.

I'm not so sure. I recommend you check the other change that was made at the same time. i.e. in Texts.Read before drawing any conclusions:

Before:

      IF R.ref.f = TrailerFile THEN R.eot := TRUE END;
      R.org := R.org + R.off; R.off := 0;
      R.ref := R.ref.next; R.org := R.org + R.off; R.off := 0; 

After:

      IF R.ref.f = TrailerFile THEN R.eot := TRUE END;
      R.ref := R.ref.next; R.org := R.org + R.off; R.off := 0;

Regards,
Chris

Chris Burrows
CFB Software
http://www.astrobe.com





More information about the Oberon mailing list