BBC BASIC for Windows
« Opening a txt file »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:44pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Opening a txt file  (Read 1189 times)
Ken Down
Guest
xx Re: Opening a txt file
« Reply #5 on: Apr 27th, 2010, 8:59pm »

I must admit that when reading a file prepared with NotePad (or other text editor) I prefer the GET$# command.

A line in NotePad ends with CHR$10+CHR$13 and GET$# will get everything up to the CHR$10, which means that the next GET$# command will read just the CHR$13, hence the following:

a$=GET$#F%:IFa$=""a$=GET$#F%

If you want to write to a text file, however, BBC BASIC only writes the string plus CHR$10. This means that all the lines run together in NotePad with funny rectangles between them. The solution is to add the CHR$13:

BPUT#F%,a$+CHR$13

The text file will now be readable in NotePad.
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Opening a txt file
« Reply #6 on: Apr 27th, 2010, 9:53pm »

on Apr 27th, 2010, 8:59pm, Guest-Ken Down wrote:
A line in NotePad ends with CHR$10+CHR$13

No it doesn't! A line in NotePad ends with CHR$13+CHR$10 (CRLF).

Richard.
« Last Edit: Apr 27th, 2010, 10:55pm by admin » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls