Does anyone know of any way to dynamically get the value of a parameter by name? I'm trying to create a function that will dynamically pass on its parameters. I'm using Reflection to get the name of the parameter but can't seem to figure out how to get the value that was passed to the function.
Example:
Imports System.Reflection
Console.WriteLine(Test("Xyzzy"))
' Should print: Xyzzy
Function Test(ByVal x as String)
Return GetValueByName(MethodBase.GetCurrentMethod.GetParameters(0).Name))
End Function