title: Get variable value by name
body: <p>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.</p>
  
  <p>Example:</p>
  
  <pre><code>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
  </code></pre>