Description Usage Arguments Details Value Author(s) See Also Examples
This function creates a "markedBlock" object, which is
a description of a block of binary data. This can be used
as part of a description of a binary format.
1 2 3 | markedBlock(marker=integer4,
switch=function(marker) { ASCIIchar },
markerLabel="marker", blockLabel="block")
|
marker |
A |
switch |
A function that returns a |
markerLabel |
A label to name the marker component of the
|
blockLabel |
A label to name the component that is read
after the marker component of the
|
A "markedBlock" object describes a block of binary data that consists
of a “marker” block containing information on further blocks.
The marker block is read first, then this block is passed
to the switch function. The switch function
can look at the contents of the marker block and decide
what sort of block should be read next (the blockValue()
function may be useful here). The result of the
switch function is read from the end of the marker
block. The marker block and the result of the switch
function can be any type
of "memBlock" object. If the result of the switch()
function is NULL then only the marker block is returned
(no further memory is read).
A "markedBlock" object.
Paul Murrell
memFormat
readFormat
memBlock
atomicBlock
vectorBlock
lengthBlock
mixedBlock
blockValue
1 2 3 4 5 6 | # A single-byte integer which dictates how many
# subsequent four-byte reals to read
markedBlock(integer1,
function(marker) {
lengthBlock(real4, blockValue(marker))
})
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.