Writes a byte to a binary file at the current file location.

syntaxSyntax:
DlxFile.WriteByte(value)

Parameters

Parameter Description
value A value between 0 and 255.

Return Value

If the operation ends correctly it returns true otherwise it returns false.

Example

  Copy codeCopy code
var filename = "demofile.bin";
// write file
var file = new DlxFile(filename, DlxApp.FILEOPEN_WRITEBINARY);
if (file.IsValid())
{
  for (var i = 0; i <= 90; i++)
	file.WriteByte(i);
  file.Close();
}
// read file
file = new DlxFile(filename, DlxApp.FILEOPEN_READBINARY);
if (file.IsValid())
{
  while (!file.IsEOF())
	DlxApp.Printf(file.ReadLine());
  file.Close();
}
else DlxApp.Printf("File not found.");

See also