Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.

For information on migrating to InterSystems IRIS, see Why Migrate to InterSystems IRIS?

$ZBITSTR (legacy function) (ObjectScript)

Bitstring function – STRING.




Argument Description
size Positive integer.
truthval Optional — Specifies a binary value (0 or 1) for the returned bits.


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

$ZBITSTR returns a bitstring whose length is size bits long, with all of its bits set to truthval.



Positive integer. The integer must be in the range 1 to 262,128 bits (32766 x 8). It can be specified as a value, a variable, or an expression.


Specifies a binary value (0 or 1) for the returned bits. If truthval is 0, or is omitted, all the bits are set to 0 (OFF). If truthval is 1, all the bits are set to 1 (ON).


The following example creates a bitstring named bs:

SET bs=$ZBITSTR(4,1)

If size=4 and truthval=1, then the result of $ZBITSTR would be a bitstring with the value [1,1,1,1].

See Also