hello,
Is there a request to know the state of a bit in an integer variable .
Example: < Variable Name > .X1
With X1 being the state of bit 1 of the variable ( INT format).
Thank you in advance
Read a BIT in the Integer variable
- michel.eijgermans
- Posts:46
- Joined: Mon Aug 08, 2011 11:50 am
Re: Read a BIT in the Integer variable
The getBit() function can be used. It receives a bit32 variable. The int-variable can be casted to a bit32 variable.
main()
{
int iInt = 32;
for (int i = 1; i < 10; i++)
{
DebugN("bitvalue:",getBit((bit32)iInt,i));
}
}
main()
{
int iInt = 32;
for (int i = 1; i < 10; i++)
{
DebugN("bitvalue:",getBit((bit32)iInt,i));
}
}