Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
21
Task/Input-loop/REBOL/input-loop.rebol
Normal file
21
Task/Input-loop/REBOL/input-loop.rebol
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
REBOL [
|
||||
Title: "Basic Input Loop"
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue