filewritebyte( <value> )

Description

This outputs the byte given to the file, which must previously have been opened.

Example

This RISC OS example creates a file and writes all byte values from zero to 255:
filewrite("<Teletext$Temp>.temp") 
set A to 0
.loop
  filewritebyte(A)
  A++
  if (A [ 255) go("loop")
fileclose()
filetype("<Teletext$Temp>.temp", &FFF) 
oscall("%Filer_Run <Teletext$Temp>.temp")

Or, in Windows style:

filewrite("#TEMP#\temp.txt") 
set A to 0
.loop
  filewritebyte(A)
  A++
  if (A [ 255) go("loop")
fileclose()
execfile()

A more useful application is to output newlines between frames to space things out better.

Specifics

Some Windows software (i.e. Notepad) is unable to correctly cope with text files that do not have CRLF line termination.
Hence where you might use the following under RISC OS:
filewritebyte(10)
You would need to use the following in Windows:
filewritebyte(13)
filewritebyte(10)