<ident> = <blob>.invert({<range> ,...})
or
<blob>.invert({<range> ,...})
blob or procedure
A function which inverts the bit values within bytes of the blob.
If called as part of a blob assignment or expression, the return value of this function is a copy of the blob with the relevant bytes inverted. The whole blob is returned, not just the bytes which have been inverted. The original blob is left unchanged.
If called stand-alone, there is no return value but the blob has the bytes inverted in place.
Inverting a byte just inverts its bit values, e.g. in binary 10000000 becomes 01111111. In decimal, the byte value n becomes 255 - n.
The parameters to this function are one or more byte ranges. Each range is in the form startbyte:endbyte or just byte if only one byte is required. The ranges are comma-separated and do not have to be consecutive in byte order. Omitting the range parameters implies that all byte values are to be inverted.
The code of this function cannot be redefined.
Invert all bits in a blob:
myblob.invert()
Invert a range of bytes (11 bytes in total), and return the result into another blob:
blob newblob = myblob.invert(11:20,25)
Commands: |
|
Structures: |