Note the argument of the function is named strToothpaste. When the function is called, the variable that's passed in uses the same name.
Private Sub DoThis()
Dim strToothpaste as String
Dim booSmellsFunny as Boolean
booSmellsFunny = fnc_Fragrance(strToothpaste)
End Sub
--------------------------
Private Function fnc_Fragrance(strToothpaste As String) as Boolean
If strToothpaste Like "Dr Watson's" Then
fnc_Fragrance = True
Else
fnc_Fragrance = False
End If
End Function
- Is there ever a problem with re-using the name?
- If variables aren't properly limited in scope, does echoing the names become hazardous?
- If the above is true, then does that mean good scoping means the names can be echoed with no problem?
- Does recursion affect anything? (Apart from double-checking the scopes ...)