November 2002
Beginner
432 pages
11h 44m
English
If you nest one If...Else statement inside another, you'll have to use ElseIf to start the nested statement. Consider the code in Listing 8.2.
If (intHours <= 40) Then
curOverTime = 0.0
' Now test for hours between 40 and 50
' and pay time and a half
ElseIf (intHours <= 50) Then
curOverTime = (intHours - 40) * 1.5 * sngRate
Else
' Must pay double time over 50 and
' time and a half for the hours between
' 40 and 50
curOverTime = ((intHours - 50) * 2 + (10 * 1.5)) *
sngRate
End If
|
caution
![]() | The Not logical operator works on a single value, unlike the other ... |