• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Using GoTo

There’s one final flow-of-control statement that you should know about: the GoTo statement. GoTo produces an unconditional change in the flow of your program. Here’s an example of the GoTo statement in action:

Sub CalculateBill(curRate As Currency, intHours As Integer)
  ' Calculate the bill for this line item
  If intHours > 100 Then
    GoTo ExitHere
  End If
  Debug.Print curRate * intHours
ExitHere:
End Sub


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint