CT_ISBIT

 ISBIT()
 Tests the bits in a number
------------------------------------------------------------------------------
 Syntax

     ISBIT(<nLONG|cHexLONG>,[<nBitPos>]) --> lSet

 Arguments

     <nLONG|cHexLONG> Designates either a decimal number or hexadecimal
     digit string.

     <nBitPos>  Designates the bit number to test.  The value can lie in
     the range of 1 to 32.  The default is the least-significant bit.

 Returns

     When the designated bit is set, the function returns a result of .T..

 Description

     ISBIT() tests a particular bit within a numeric field, without having to
     mask it or do a comparison.

 Example

     Tests the BREAK bit in the line status register of the COM1 serial
     interface:

     IF ISBIT(COM_LSR(1), 5)
        ? "BREAK condition detected!"
     ENDIF


See Also: NUMAND() NUMNOT() NUMOR() NUMXOR() SETBIT()

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.