title: Functions vs Sub Procedures
body: <p>I am new to vbscript and trying to use the below code with a Function and then a Sub Procedure. I am confused as to why I have to &quot;call&quot; the function as it should itself return the value without calling the function. Please see the below pieces of code - one with Function and the other one with Sub Procedure.</p>
  <h3>Function -</h3>
  <pre><code>Systemutil.Run&quot;C:\Program Files\Internet Explorer\iexplore.exe&quot;,&quot;www.gmail.com&quot;
  
  Function tester()
      Set tester=Description.Create
      tester=Browser(&quot;title:=Gmail&quot;).Page(&quot;title:=Gmail&quot;).WebButton(&quot;html id:=next&quot;).GetROProperty(&quot;Name&quot;)
      print tester
  End Function
  
  Call tester
  </code></pre>
  <p>If I don't call the function, it doesn't return anything.</p>
  <p>I have used function name as a variable to output the value.</p>
  <h3>Sub Procedure-</h3>
  <pre><code>Systemutil.Run&quot;C:\Program Files\Internet Explorer\iexplore.exe&quot;,&quot;www.gmail.com&quot;
  
  Sub tester()
      Set X=Description.Create
      X=Browser(&quot;title:=Gmail&quot;).Page(&quot;title:=Gmail&quot;).WebButton(&quot;html id:=next&quot;).GetROProperty(&quot;Name&quot;)
      print X
  End Sub
  
  Call tester
  </code></pre>
  <p>My question is why doesn't the first script work without <strong>calling</strong> the Function.</p>