Progress
Language Reference


PUT-BITS Statement

Interfaces
OS
SpeedScript
All
All
Yes

Uses the bit representation of an integer to set a given number of bits at a given location within another integer. Returns a logical value.

SYNTAX

PUT-BITS( destination , position , numbits ) = expression 

destination

A Progress integer variable. The statement sets bits in destination that correspond to the bits that are on in the source variable, expression. It clears bits in the destination variable that are 0 in the source variable. Note that the number of bits set or cleared is limited by the numbits parameter, and the location within the destination is determined by the position variable.

position

A variable or expression that returns an integer. This parameter designates the position of the lowest-order bit of the bits that are to be interpreted as an integer. Bits are numbered from 1 through the length of an integer; with 1 being the low-order bit. If position is greater than the length of an INTEGER or less than 1, Progress generates a runtime error.

numbits

The number of bits to examine when generating the return value. If position plus numbits is greater than the length of an integer plus 1, Progress generates a runtime error.

expression

A source variable that returns an INTEGER. If the INTEGER cannot be represented in the number of bits specified by numbits, Progress stores the low-order numbits bits of the INTEGER.

SEE ALSO

GET-BITS Function


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095