www.icetips.com  Icetips Utilities Documentation 6/16/2015    

Core Class: SetBit

Previous  Top  Next  


Prototype: (Long pVariable, Byte pBitToSet, Byte pBitSet), LONG

 

pVariableThe value to set bit information in
pBitToSetThe bit to change status.  Note that bits are zero (0) based so the lowest bit is 0, next is 1 and so on.
pBitSetEither 0 or 1 depending on if you want to turn the bit off or on.

 

This method is used to set a single bit in an integer value. 

 

Example:

ITC  ITCoreClass

Long

String(32)

Byte

Code

L = 8

B = 1

L = ITC.SetBit(L,B,0)

Message('Bit ' & B & ' is now: ' & ITC.GetBit(L,B)

 

See also:

GetBit
GetBitString

 



Direct link to this page: http://www.icetips.com/manuals/utilities/setbit_core.htm