Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
26
Task/Input-loop/AmigaE/input-loop.amiga
Normal file
26
Task/Input-loop/AmigaE/input-loop.amiga
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
CONST BUFLEN=1024, EOF=-1
|
||||
|
||||
PROC consume_input(fh)
|
||||
DEF buf[BUFLEN] : STRING, r
|
||||
REPEAT
|
||||
/* even if the line si longer than BUFLEN,
|
||||
ReadStr won't overflow; rather the line is
|
||||
"splitted" and the remaining part is read in
|
||||
the next ReadStr */
|
||||
r := ReadStr(fh, buf)
|
||||
IF buf[] OR (r <> EOF)
|
||||
-> do something
|
||||
WriteF('\s\n',buf)
|
||||
ENDIF
|
||||
UNTIL r=EOF
|
||||
ENDPROC
|
||||
|
||||
PROC main()
|
||||
DEF fh
|
||||
|
||||
fh := Open('basicinputloop.e', OLDFILE)
|
||||
IF fh
|
||||
consume_input(fh)
|
||||
Close(fh)
|
||||
ENDIF
|
||||
ENDPROC
|
||||
Loading…
Add table
Add a link
Reference in a new issue