I'm trying to make one of my programs read a file from
standard input, but I have had some trouble. (using pb 3.1)
If I use EOF() I get error 54 (bad file mode), and if I
look for ascii 26 it just keeps looping
example:
open "kybd:" for input as #1
open "file.x" for output as #2
while 1
x$=input$(1, 1)
if x$=chr$(26) then exit loop
print #2, x$;
wend
The program writes all of the input into "file.x", but
it never finds the eof. Any help that anyone can offer
will be of great assistance.
Dave
------------------
standard input, but I have had some trouble. (using pb 3.1)
If I use EOF() I get error 54 (bad file mode), and if I
look for ascii 26 it just keeps looping
example:
open "kybd:" for input as #1
open "file.x" for output as #2
while 1
x$=input$(1, 1)
if x$=chr$(26) then exit loop
print #2, x$;
wend
The program writes all of the input into "file.x", but
it never finds the eof. Any help that anyone can offer
will be of great assistance.
Dave
------------------
Comment