title: Isn't this how you pass dynamic array as function argument in VBScript?
body: <p>Okay, I am trying to convert the user given decimal number to binary but Internet Explorer gives me this error:</p>
  
  <p><a href="https://i.stack.imgur.com/ghHJp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ghHJp.png" alt="Type mismatch error"></a></p>
  
  <p>Isn't that how you send a dynamic array as function argument in VBScript?</p>
  
  <p><strong>VBScript code:</strong></p>
  
  <pre><code>Function toBinary(number, binary)
      Dim remainder : remainder = 0
      Dim index : index = 0
  
      While (number &lt;&gt; 0)
          remainder = number Mod 2
          number = number \ 2
          ReDim binary(index)
          binary(index) = remainder
          index = index + 1
      Wend
  
      toBinary = binary
  End Function
  
  Dim number
  Dim response : response = vbYes
  Dim binary()
  
  While (response = vbYes)
      number = InputBox("Enter A Decimal Number: ")
      If (Not IsNumeric(number)) Then
          response = MsgBox("Wrong Input, Wanna Try Again? ", vbYesNo)
      Else
          MsgBox (number &amp; " is equal to " &amp; toBinary(number, binary) &amp; " in Binary")
          response = vbNo
      End If
  Wend
  </code></pre>