Browse Source

In.Byte fixed, now it sets Done

Arthur Yefimov 1 year ago
parent
commit
33497f8b7f
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/In.Mod

+ 5 - 1
src/In.Mod

@@ -120,7 +120,11 @@ RETURN ok END GetChar;
 (** Puts in `x` the byte at the current position
 %RU Помещает в `x` байт в текущей позиции *)
 PROCEDURE Byte*(VAR x: BYTE);
-BEGIN x := SYSTEM.VAL(BYTE, SHORT(SHORT(GetByte())))
+BEGIN
+  IF readState = eof THEN Done := FALSE; x := 0
+  ELSE x := SYSTEM.VAL(BYTE, SHORT(SHORT(GetByte())));
+    IF readState = eof THEN Done := FALSE END
+  END
 END Byte;
 
 PROCEDURE ReadChar;