somebody recently told me that Select Case True is valid syntax and can be used as in the following.I am going to try it. Does anybody know if this is going to work?Code:Public Function Latitude(Y As Double, X As Double) As Double
'Function returns Radians in range -Pi/2 to Pi/2 (-90 to 90 degrees)
'Quandrant assumed to be determined by sign of Y.
'X assumed to be positive. Abs Function used to force positive value.
'Hpi = Pi/2 Qpi = Pi/4 (90 & 45 degrees)
Select Case True
Case Abs(X) > Abs(Y)
Latitude = Atn(Y / Abs(X))
Case Abs(X) < Abs(Y)
Latitude = Hpi - Atn(Abs(X) / Y)
Case X = 0
Latitude = 0
Case Else
Latitude = Qpi '45 degrees
End If
End Function
It looks cleaner that ElseIf constructs.
