Loading

SET

lists binary

The SET function replaces item at specified index in a list. If the index is greater than the size of the list, it will raise an error.

When used on a BYTE ARRAY, SET replaces the byte by the byte value. The byte value, signed or not, must be in the range of [-128,255].

Since 2.1, the index can be negative. In this case the effective index is index + size of the LIST or BYTE ARRAY.

Since 2.1, SET can set an element in a nested list. In this case, the index is a list.

SET is available since version 1.0.0.

See also

Signature

Examples

[ 'foo' 'bar' 42 ] // List with mixed types true // New item 0 // Index SET // Replace 'foo' string with a boolean
//raw payload 'FF4201FFFE8B' HEX-> 'rx' STORE //alter the first byte of the payload $rx 0x42 0 SET //print it in a string ->HEX