11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Caché</strong> <strong>ObjectScript</strong> FunctionsA bitstring is an encoded (compressed) string which is interpreted as a series of bits. Onlybitstrings created using $BIT, $FACTOR, or $BITLOGIC, or the null string (""), shouldbe supplied to the $BITLOGIC function. Typically, bitstrings are used for index operations.Refer to general information on bitstring functions in $BIT for further details.$BITLOGIC is incompatible with any of the legacy $ZBIT bitstring functions, and shouldnot be used in combination with them.Bitstring OptimizationThe most basic $BITLOGIC operation is $BITLOGIC(a). Seemingly, this operation doesn'tdo anything: bitstring a is input and the same bitstring a is output. However, $BITLOGICperforms bitstring compression which it optimizes by selecting from several compressionalgorithms. Therefore, if bitstring a has undergone substantial changes since its creation,passing it through $BITLOGIC can result in re-optimization of the bitstring. Refer to $BITfor further details.For example, following a large number of delete operations an index bitstring may havebecome a sparse bitstring, consisting wholly or mainly of zeros. Passing this index bitstringthrough $BITLOGIC may result in substantial performance improvements.Bitstring Logical Operators$BITLOGIC can evaluate only the bitstring operators listed in the following table:Operator&|~MeaningANDORNOT (one's complement)The bitstring_expression can contain a single bitstring (~A), two bitstrings (A&B), or morethan two bitstrings (A&B|C), up to the current maximum of 31 bitstrings. Evaluation is performedleft-to-right. Logical operations may be grouped by parentheses within thebitstring_expression, following standard <strong>Caché</strong> <strong>ObjectScript</strong> order of operations. If a variableused within $BITLOGIC is undefined, it is treated as a null string ("").$BITLOGIC treats a null string as a bitstring of indefinite length, in which all bits are setto 0's.188 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!