RosettaCodeData/Task/Input-loop/REBOL/input-loop.rebol
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

23 lines
413 B
Text

REBOL [
Title: "Basic Input Loop"
Author: oofoe
Date: 2009-12-06
URL: http://rosettacode.org/wiki/Basic_input_loop
]
; Slurp the whole file in:
x: read %file.txt
; Bring the file in by lines:
x: read/lines %file.txt
; Read in first 10 lines:
x: read/lines/part %file.txt 10
; Read data a line at a time:
f: open/lines %file.txt
while [not tail? f][
print f/1
f: next f ; Advance to next line.
]
close f