The Proxy Variable

Top  Previous  Next

You don't really have to be aware of this, but it doesn't hurt...

 

When CodeShine's Extract Method is used with a return value, CodeShine creates a proxy variable in the extracted code. In this example, the extracted code is this:

 

Private Function positionOfLastDelimiter(sourceStr As String, delimiters As String) As Integer

Dim i As Integer

Do While (i > 0) And (InStr(delimiters, Mid$(sourceStr, i, 1)) > 0)

    i = i - 1

Loop

positionOfLastDelimiter = i

End Sub

 

i was the variable name in the original routine. In this extraction, a local variable i is created, and it is used to hold the function result until the final line.

 

You can change the name of the proxy variable in the Extract Method parameters grid.

 

If the return type is an object, generic setting and object creation/destruction code is generated for the proxy object, but it may need to be hand-modified depending on the nature of the classes involved.