Hi all.
It might be the late hour but I can't figure out why this little piece of code won't work when I apply it in the real world:
Code:
' selectTest should eval to true...
Sub doTest()
selectTest 543
End Sub
Function selectTest(intAntal%)
Select Case (intAntal)
Case ((30 / 20) * 100), Is >= 100
selectTest= True
Exit Function
Case Else
selectTest= False
End Select
End Function
While this work, the equaling
real code won't:
Code:
With objStation.Parkeringer(intP).Taellinger(intT)
Select Case (.intAntalPladser)
Case 0
SkalMed = True
If .intAntalParkeret = 0 Then
MsgBox "På " & objStation.strNavn & " er der en tælling med" & _
" 0 P-pladser og 0 parkeret." & Chr(10) & _
"Stationen kommer med i rapporten.", vbInformation, "Advarsel"
End If
Exit Function
Case ((.intAntalParkeret / .intAntalPladser) * 100), Is >= intBelaegningsprocent
SkalMed = True
Exit Function
Case 1345, Is > 90 ' the code should at least stop here... but doesn't
Stop
Case Else
SkalMed = False
End Select
End With
The above select case (almost) always returns false. It seems like it works sometimes. Like when
intBelaegningsprocent is set to 5 but not 80 or 90.
Any ideas on why this happens?!?
- mega
Moving to C# .NET