I have not run into this before and I've banged my head on my desk enough
today so I must ask the vba guru's out there: "How can this happen?"
I can step through my macro and it all works as intended EXCEPT for the
following portion of code tha fails at the same place everytime....well, it
doesn't fail but it does enter an If function as if it evaluated to true
when I KNOW that it is not true, since the conditions have not been met, as
shown in the Locals window.
tan, entNext and ent are both set and valid, arc is dimmed but not set
at this point in the code it correctly evaluates 1* as false, goes to 2*
which correctly evaluates true, goes to 3* and this incorrectly evaluates as
true, even though the first test is should be false since ent.type evaluates
to kTangent and then the second test should fail anyway since arc has not
yet been set. By all rights, it should get all the way to 4* before the If
evaluates to True.
Any ideas as to why this happens?
1* If entNext.Type = kCurve And entNext.CCWFlag = True Then
If ent.Type = kCurve And arc.CCWFlag = True Then
aData(X - 1, 1) = "PCC"
ElseIf ent.Type = kCurve And arc.CCWFlag = False Then
aData(X - 1, 1) = "PRC"
End If
2* ElseIf entNext.Type = kCurve And entNext.CCWFlag = False Then
3* If ent.Type = kCurve And arc.CCWFlag = True Then
aData(X - 1, 1) = "PRC"
ElseIf ent.Type = kCurve And arc.CCWFlag = False Then
aData(X - 1, 1) = "PCC"
End If
4* ElseIf entNext.Type = kCurve And ent.Type = kTangent Then
aData(X - 1, 1) = "PC"
ElseIf entNext.Type = kTangent Then
If ent.Type = kCurve Then
aData(X - 1, 1) = "PT"
ElseIf ent.Type = kTangent Then
aData(X - 1, 1) = "PI"
End If
End If
--
Jeff Mishler
remove USES from email address to reply