BITS function   

Purpose

Return the least significant portion of an integer class expression.  Allows easy conversion between signed and unsigned expressions.

Syntax

resultvar = BITS(datatype, expression)

Remarks

Condenses the functionality of BITS%BITS&BITS?BITS??, and BITS??? into a single function, and returns the least-significant bits of expression.

datatype

The parameter datatype may be BYTE, WORD, DWORD, INTEGER, or LONG.

expression

An integer class expression, variable, or numeric literal.

Restrictions

The BITS syntax provides for the addition of new data types in future versions of PowerBASIC, which may not support type-specifier characters.  Existing code should be converted to the new syntax as soon as possible.

See also

BIT CALC statementBIT functionBIT statementBITS functions