Skip to main content

$ZBITSET (legacy function)

Bitstring function – SET.

Synopsis

$ZBITSET(bitstring,position,truthval)

Parameters

Argument Description
bitstring The bitstring to be set.
position Positive integer that specifies a location in bitstring.
truthval Single-bit binary value (0 or 1).

Description

This page describes the legacy function $ZBITSET. It is described here for compatibility with legacy applications.

$ZBITSET returns a permutation of bitstring in which the bit at position is set to truthval(0 or 1).

Parameters

position

Positive integer that specifies a location in bitstring. It can be specified as a value, a variable, or an expression. Bits are counted left-to-right, with the first bit counted as number 1.

truthval

Single-bit binary value (0 or 1).

Example

The following example creates a bitstring using $ZBITSTR, then sets a bit using $ZBITSET.

SET bitstring=$ZBITSTR(5,0)

SET newbitstring=$ZBITSET(bitstring,3,1)

If bitstring=[0,0,0,0,0], position=3, and truthval=1, then the result of $ZBITSET would be a bitstring with the value [0,0,1,0,0].

See Also

FeedbackOpens in a new tab