lang • memory

MEMORY

Stream = MEMORY Pointer [ FOR [ READ ] [ WRITE ] ]

Create a stream that allows to directly read binary data from memory, or write binary data to memory.

The first read or write is done at the memory address specified by Pointer, but beware that reading or writing to the stream makes the stream internal pointer go forward.

The stream position set by SEEK or returned by Seek is the number of bytes from Pointer.

If you try to write to a forbidden memory address, you will get an error. The interpreter won't crash.

IMPORTANT!

Reading or writing a string on a memory stream with the READ or WRITE instructions does not use the Gambas Binary Data Representation.

Instead, null-terminated strings are read or written.

See also