RosettaCodeData/Task/Input-loop/Phixmonti/input-loop.phixmonti

20 lines
360 B
Plaintext

/# Rosetta Code problem: http://rosettacode.org/wiki/Input_loop
by Galileo, 10/2022 #/
include ..\Utilitys.pmt
def eof? dup -1 == enddef
"input.txt" "r" fopen
( inf 0 -1 ) for drop
dup fgets eof? if drop exitfor else print endif
endfor
fclose
"input.txt" "r" fopen
eof? not while
dup fgets eof? if drop false else print true endif
endwhile
fclose