what dose mean this code

If (B And &H80s) Then
IIC_tx_bit_1()
Else
IIC_tx_bit_0()
End If

IIC_tx_bit_1() and IIC_tx_bit_0() are functions

2. Re: small question about if?

The AND in the expression is a bitwise AND. A bitwise AND means that you perform an AND on each individual pair of bits to get the corresponding bit in the result. That expression will evaluate to True if any of the corresponding bits in the two values are both set, e.g.

0110 AND
1001 =
0000 => False

0110 AND
0100 =
0100 => True

A bit is only set in the result if the corresponding bit in both operands is also set. If the result is non-zero then it evaluates to True. You can also perform bitwise OR and bitwise XOR.

In that code it basically means that if the first bit in B is set the execute the first method, otherwise execute the second method.

3. Re: small question about if?

thanks a lot i have another problem could you help me please!!
what dese mean this code

SDA_value = MSComm1.CTSHolding

4. Re: small question about if?

Originally Posted by vbnm
thanks a lot i have another problem could you help me please!!
what dese mean this code

SDA_value = MSComm1.CTSHolding
post all the code...with the module and procedure declarations, please...

5. Re: small question about if?

Ya, the line as you have it assigns the value from MSComm1.CTSHolding to the variable SDA_value. Why that is being done is unclear from the code, just as it is unclear what either of those values actually are.

6. Re: small question about if?

Can I suggest that you keep each thread to a single topic? If you have an unrelated question you should ask it in a new thread. That helps to keep the forums more orderly and makes it easier to find the information you want when searching.

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•