643 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 - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...