RosettaCodeData/Task/Input-loop/NetRexx/input-loop-1.netrexx

22 lines
479 B
Text
Raw Permalink Normal View History

2013-04-10 22:43:41 -07:00
/* NetRexx */
options replace format comments java crossref symbols nobinary
-- Read from default input stream (console) until end of data
lines = ''
lines[0] = 0
lineNo = 0
loop label ioloop forever
inLine = ask
2015-02-20 00:35:01 -05:00
if inLine = null then leave ioloop -- stop on EOF (Try Ctrl-D on UNIX-like systems or Ctrl-Z on Windows)
2013-04-10 22:43:41 -07:00
lineNo = lineNo + 1
lines[0] = lineNo
lines[lineNo] = inLine
end ioloop
loop l_ = 1 to lines[0]
say l_.right(4)':' lines[l_]
end l_
return