langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
23
Task/Input-loop/REBOL/input-loop.rebol
Normal file
23
Task/Input-loop/REBOL/input-loop.rebol
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue