Math.Or |
Top Previous Next |
Syntax function Math.Or(Op1, Op2: integer): integer
Alternative Names
Description Performs a bitwise logical OR operation.
Both Op1 and Op2 hold a value, then Return Value is a bitwise logical OR operation for each bit in the input values.
Bitwise AND is performed as follows for bit values p & q:
See Also
Example execute UDSBlock as begin Op1 = 3; /* 11 in binary */ Op2 = 1; /* 01 in binary */ Res = Math.And(Op1, Op2); /* Result 01 in binary, 1 in decimal */ GUI.ShowMessage('Result 01 (bin) = 1 (dec): ' || Res);
Op1 = 2; /* 10 in binary */ Op2 = 1; /* 01 in binary */ Res = Math.Or(Op1, Op2); /* Result 11 in binary, 3 in decimal */ GUI.ShowMessage('Result 11 (bin) = 3 (dec): ' || Res);
Op1 = 2; /* 10 in binary */ Op2 = 3; /* 11 in binary */ Res = Math.Xor(Op1, Op2); /* Result 01 in binary, 1 in decimal */ GUI.ShowMessage('Result 01 (bin) = 1 (dec): ' || Res); end |