BitOr - Execute a binary OR operation on a list of values

Top  Previous  Next

Syntax

<nReturnValue> := BitOr( <nVal1>, <nVal2> {,<nValn>} )

Parameters

<nVal1..n>

 

Numeric parameters containing LONG values to be used in the binary OR operation.

Return value

The result of binary ORing all parameters.

Description

BitOr executes a binary OR operation (32 bits wide) with all parameters passed. All parameters must contain LONG values. The return value is a  LONG value with those bits set to 1 which were 1 in at least one parameter. This function is used when the macro (a | b) is expanded.

Classification

Core

Category

Bit manipulation

Quick Info

Library: cckptcor.lib / cckptcor.dll

See also

|, BitNot, BitAnd, BitXor

Example

 

#INCLUDE "CockpitCoreLibs.ch"

#INCLUDE "cmacros.ch"

 

FUNCTION Main

 

* This will output the value 7

? BitOr(1,2,4)  

 

* This is the equivalent in C syntax supported by Cockpit

? (1 | 2 | 4)

 

RETURN NIL