by Richard Russell, June 2010
When you write to a sequential data file using PRINT# or BPUT# the data is buffered by BBC BASIC before being output to Windows (typically for storage on disk). This is done for reasons of performance, because transferring data in blocks is more efficient than transferring it one byte at a time. A similar process occurs when you are reading from a file.
These buffering operations normally happen transparently, and you don't need to be aware of them. However there are a couple of circumstances in which the existence of the buffers can matter to your BBC BASIC program:
In both cases flushing BBC BASIC's file buffer is simply a case of issuing the following statement:
PTR#chan% = PTR#chan%