mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 07:32:24 +00:00
ReadString and ReadLine from Files module now set the trailing 0X
This commit is contained in:
parent
b8694e65ab
commit
e4aca9f6f9
1 changed files with 4 additions and 2 deletions
|
|
@ -636,7 +636,8 @@ Especially Length would become fairly complex.
|
|||
PROCEDURE ReadString* (VAR R: Rider; VAR x: ARRAY OF CHAR);
|
||||
VAR i: INTEGER; ch: CHAR;
|
||||
BEGIN i := 0;
|
||||
REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X
|
||||
REPEAT Read(R, ch); x[i] := ch; INC(i) UNTIL ch = 0X;
|
||||
x[i] := 0X;
|
||||
END ReadString;
|
||||
|
||||
PROCEDURE ReadLine* (VAR R: Rider; VAR x: ARRAY OF CHAR);
|
||||
|
|
@ -652,7 +653,8 @@ Especially Length would become fairly complex.
|
|||
x[i] := ch;
|
||||
INC(i);
|
||||
END;
|
||||
UNTIL b
|
||||
UNTIL b;
|
||||
x[i] := 0X;
|
||||
END ReadLine;
|
||||
|
||||
PROCEDURE ReadNum* (VAR R: Rider; VAR x: LONGINT);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue