Poke -- write to a memory block (V2.0)
Poke(id, offset, val[, type, endian])
This function writes the value or string specified in val to the memory block with the identifier id at the specified offset. Type defaults to #INTEGER and specifies the type of val. You can also use the following types: #BYTE (1 byte), #SHORT (2 bytes), #FLOAT (4 byte single-precision floating point number), #DOUBLE (8 byte double-precision floating point number) or #STRING. Poking a string into a memory block occupies the number of characters in the string plus 1 byte.

Starting with Hollywood 6.0 there is a new endian parameter which allows you to specify the byte order that should be used when writing the data to the memory block. This can be set to the following types:

Big endian byte order, MSB first. This is the default.

Native endian byte order. If you use this type, the byte order will depend on the default byte order on the host system, i.e. big endian on big endian systems, little endian on little endian systems. Be careful using this type because it limits portability.

Little endian byte order, LSB first. (V8.0)

identifier of the memory block to be used
where to poke (in bytes)
data to poke; can be string or number
optional: data type to poke (defaults to #INTEGER)
optional: byte order to use (defaults to #BIGENDIAN) (V6.0)
AllocMem(1, 1024)
Poke(1, 0, "Hello World!", #STRING)
Print(Peek(1, 0, #STRING))
This will print "Hello World!" to the screen.

Show TOC