title: VBScript: Passing Object to Function?
body: <p>The below example generates an error:</p>
  
  <p><em>VBScript compilation error: Cannot use parentheses when calling a Sub</em></p>
  
  <p>This error does not occur if all parameters are not objects.</p>
  
  <p>Is there a special way to pass object parameters to VBScript functions?</p>
  
  <pre><code>Option Explicit
  
  Dim obj
  
  Function TestFunc(obj)
   WScript.Echo "Why doesn't this work?"
  End Function
  
  Set obj = CreateObject("Scripting.Dictionary")
  obj.Add("key", "val")
  
  TestFunc(obj) ' Error here!
  </code></pre>