M
Mahadevan Swamy
Hi,
I am using excel and VB to do my work and when some wrong result is
returned in excel, I debug my code to find where it is wrong. When I
evaluated a particular statement: -
'Checks if the edges and sensor center point are close to the line B
ElseIf (Abs((Abs((mB * SensorX) - SensorY + cB) / (Sqr((mB ^ 2) + 1)))
- SensorRadius) <= 0.03) Or
((Abs((mB * SensorX) - SensorY + cB) / (Sqr((mB ^ 2) + 1))) <= 0.03)
And
((SensorY > ((mC * SensorX) + cC))
And
(SensorY < ((mA * SensorX) + cA)))
Then
InRange = "X"
I found out that 1st, 2nd and 4th statments gave me True whereas the
third statment gave me a False. Now the entire result must be a False.
(True or True And False And True) = False. But instead I get True.
What is wrong???? I have assigned my brackets correctly and I cant see
why this problem is caused? Can anyone please help? Thanks
Swamy
I am using excel and VB to do my work and when some wrong result is
returned in excel, I debug my code to find where it is wrong. When I
evaluated a particular statement: -
'Checks if the edges and sensor center point are close to the line B
ElseIf (Abs((Abs((mB * SensorX) - SensorY + cB) / (Sqr((mB ^ 2) + 1)))
- SensorRadius) <= 0.03) Or
((Abs((mB * SensorX) - SensorY + cB) / (Sqr((mB ^ 2) + 1))) <= 0.03)
And
((SensorY > ((mC * SensorX) + cC))
And
(SensorY < ((mA * SensorX) + cA)))
Then
InRange = "X"
I found out that 1st, 2nd and 4th statments gave me True whereas the
third statment gave me a False. Now the entire result must be a False.
(True or True And False And True) = False. But instead I get True.
What is wrong???? I have assigned my brackets correctly and I cant see
why this problem is caused? Can anyone please help? Thanks
Swamy