Input/Output for lines of text: Difference between revisions
Content added Content deleted
m (→{{header|Phix}}: added syntax colouring, marked p2js incompatible) |
(Added XPL0 example.) |
||
Line 1,075: | Line 1,075: | ||
Pack my Box with 5 dozen liquor jugs |
Pack my Box with 5 dozen liquor jugs |
||
</pre> |
</pre> |
||
=={{header|XPL0}}== |
|||
The input file must be redirected on the command line, for example: iotext <iotext.txt |
|||
<lang XPL0>string 0; |
|||
proc PrintLn(Str); \"method" to print a line of text |
|||
char Str; |
|||
[Text(0, Str); |
|||
CrLf(0); |
|||
]; |
|||
char Line(1000); |
|||
int N, I, C; |
|||
for N:= 1 to IntIn(1) do |
|||
[I:= 0; |
|||
loop [repeat C:= ChIn(1) until C # $0D \CR\; |
|||
if C = $0A \LF\ then quit; |
|||
Line(I):= C; |
|||
I:= I+1; |
|||
]; |
|||
Line(I):= 0; |
|||
PrintLn(Line); |
|||
]</lang> |
|||
=={{header|zkl}}== |
=={{header|zkl}}== |