11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ExamplesIf bitstring= [0,0,1,1,0], then the result of $BITCOUNT(bitstring) is 5:$BITCOUNTSET $BIT(a,1) = 0SET $BIT(a,2) = 0SET $BIT(a,3) = 1SET $BIT(a,4) = 1SET $BIT(a,5) = 0WRITE !,$BITCOUNT(a)If bitstring = [0,0,1,1,0], then the result of $BITCOUNT(bitstring,0) would be 3.SET $BIT(a,1) = 0SET $BIT(a,2) = 0SET $BIT(a,3) = 1SET $BIT(a,4) = 1SET $BIT(a,5) = 0WRITE !,"number of zero bits:",$BITCOUNT(a,0)WRITE !,"number of one bits: ",$BITCOUNT(a,1)See Also• $BIT function• $BITFIND function• $BITLOGIC function• $FACTOR function<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 185

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

Saved successfully!

Ooh no, something went wrong!