| 1 |
MODULE testrestline ; |
| 2 |
|
| 3 |
IMPORT SeqFile, TextIO ; |
| 4 |
|
| 5 |
VAR |
| 6 |
chan : SeqFile.ChanId ; |
| 7 |
line : ARRAY [0..5] OF CHAR ; |
| 8 |
results : SeqFile.OpenResults ; |
| 9 |
BEGIN |
| 10 |
SeqFile.OpenWrite (chan, "test.input", SeqFile.write, results) ; |
| 11 |
TextIO.WriteString (chan, "a line of text exceeding 6 chars") ; |
| 12 |
TextIO.WriteLn (chan) ; |
| 13 |
TextIO.WriteString (chan, "a second lineline of text exceeding 6 chars") ; |
| 14 |
TextIO.WriteLn (chan) ; |
| 15 |
SeqFile.Close (chan) ; |
| 16 |
|
| 17 |
(* Now see if we can read the first line. *) |
| 18 |
SeqFile.OpenRead (chan, "test.input", SeqFile.read, results) ; |
| 19 |
TextIO.ReadRestLine (chan, line) |
| 20 |
END testrestline. |