Name
ReadBytes -- read bytes from file (V7.0)
Synopsis
data$ = ReadBytes(id[, len])
Function
This function reads len bytes from the file specified by id. If the len argument is omitted, ReadBytes() will read all bytes from the current file cursor position until the file end. ReadBytes() will advance the file cursor position by the number of bytes read.

This function is useful for reading binary data from a file. Since Hollywood strings can store binary data as well as text, ReadBytes() can just copy all the bytes it has read from the file in a Hollywood string and return it.

Inputs
id
file to read data from
len
optional: number of bytes to read (defaults to 0 which means read until file end)
Results
data$
data read from file
Example
See WriteBytes


Show TOC