353 views
in GUI Development by
I am trying to do a mask with a variable in order to get the state of each bit inside this variable.
I tried the "&&" instruction but apparently it is not recognized…
Could you tell me what is the proper instruction to do that?

1 Answer

0 votes
by

The '&&' operator is the logical AND operator, which can be used to combine boolean operands. 
Example:

var bool a = true;
var bool b = true;
var bool c;

c = a && b; // c = true

In order to mask an integer variable with an integer mask, you can use the bitwise AND operator '&'.
Example:

var uint32 a = 0xFF003AC0;
var uint32 b = 0xAB15FF70;
var uint32 c;

c = a & b; // c = 0xAB003A40

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...