The Next Extract - a Deliberate Mistake

Top  Previous  Next

Let's look a bit forward in the code:

 

lastWord5

 

Note that I've included the Dim statement for ans, even though ans is referenced in the last line of the calling procedure. Click Extract Method and see how CodeShine compensates for this:

 

lastword6

 

CodeShine does the smart thing: it includes ans as a parameter, and leaves the Dim statement back in the calling procedure.