Well, "basically," it doesn't seem to work, though I've tried every variation I can think of (easily 20+, mainly variations of PRINT #1 and WRITE #1 from the GW-Basic program).
The output to the file is one to three integers in a four space field. This works fine in the output file, but it all comes out in one continuous line rather than breaking into separate lines where the line feed character was supposed to go.
By the way, the program works fine when the output is on the screen: the lines break where they are programmed to do so. I'm not sure whether the program sends CHR$(10) to the output file or not. FIND does not recognize it there, but it does not recognize some of the integers either, so it is perhaps inappropriate for this purpose.
Thank you for your consideration...and, I hope, help.
Richard
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Richard, happy to help. Could you clarify what the problem is? I'm afraid I don't understand from your message what it is that doesn't work. Would you be able to send me the GW-BASIC program you're trying to run, which isn't working correctly?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
open "output.txt" for output as 1
print#1, 12;chr$(10);32767;chr$(10);45;chr$(10)
close
works without problems for me; the output is three integers delimited by LF characters.
12
32767
45
What program do you use to view the output? Notepad on Windows, for example, will not show LFs correctly: you'll get everything on one line. Wordpad or most other text editors will do fine. The best way to check is to use a hex editor; the above output.txt looks for me like this:
View and moderate all "[CLOSED] General Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Well, "basically," it doesn't seem to work, though I've tried every variation I can think of (easily 20+, mainly variations of PRINT #1 and WRITE #1 from the GW-Basic program).
The output to the file is one to three integers in a four space field. This works fine in the output file, but it all comes out in one continuous line rather than breaking into separate lines where the line feed character was supposed to go.
By the way, the program works fine when the output is on the screen: the lines break where they are programmed to do so. I'm not sure whether the program sends CHR$(10) to the output file or not. FIND does not recognize it there, but it does not recognize some of the integers either, so it is perhaps inappropriate for this purpose.
Thank you for your consideration...and, I hope, help.
Richard
Hi Richard, happy to help. Could you clarify what the problem is? I'm afraid I don't understand from your message what it is that doesn't work. Would you be able to send me the GW-BASIC program you're trying to run, which isn't working correctly?
Hi Richard, I had another look at this. This:
works without problems for me; the output is three integers delimited by LF characters.
What program do you use to view the output? Notepad on Windows, for example, will not show LFs correctly: you'll get everything on one line. Wordpad or most other text editors will do fine. The best way to check is to use a hex editor; the above
output.txt
looks for me like this:where the LFs are shown as character
0a
. This is identical to the output of GW-BASIC for the same commands.If you want a line break that works with Notepad, use CRLF, like this:
or simply use separate
PRINT
statements for each number.Hope this helps,
Rob