|, %| Function

Purpose

Performs a logical bit-wise Or on two bit patterns.

Syntax

i | j

i %| j

i, j:integer expression

Description

i | j sets only the bits which are set in at least one of the two operands i or j. For completeness with %& (which replaces the & - And operator), the %| operator is added as a replacement for |.

Example

Print Bin$(3, 4)       // Prints 0011

Print Bin$(3 | 10, 4// Prints 1011

Print Bin$(5 %| 10, 4) // Prints 1111

Remarks

Or is synonymous with | and can be used instead:

Print Bin$(3 Or 10, 4) // Prints 1011

See Also

And, Or, Xor, Imp, Eqv, %&, ~

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