Writing small subroutines allows for them to be used as building blocks to define a macro which the user can execute.
In the following steps, you create a macro named Gardenpath. The macro executes the smaller subroutines that were previously defined as part of the Garden Path project, resulting in the creation of a garden path.
- In the Code window, click after the End Sub statement of the drawtiles subroutine and press Enter twice.
- Type the following code:
' Main function that combines the individual Private subroutines ' of the project into a single macro to simplify execution. Public Sub gardenpath() ' Request input from the user gpuser ' Draws the outline of the garden path drawout ' Draws the tiles in the outline of the garden path drawtiles End Sub
- Save the project.