|= Assignment

Purpose

Performs a logical bit-wise Or on two bit patterns, whereby the first pattern must be in an integer variable.

Syntax

i |= j

i:ivar

j:integer expression

Description

I |= j sets in the integer variable i, only the bits which are set in either i or j.

Example

Print Bin$(3, 4// Prints 0011

Print Bin$(10, 4) // Prints 1010

Local i% = 3

i% |= 10

Print Bin$(i%, 4) // Prints 1011

Remarks

i = i | j and i = i Or j are synonymous with i |= j and can be used instead.

See Also

&=, ^=

{Created by Sjouke Hamstra; Last updated: 23/09/2014 by James Gaite}