title: How do you use a collection as an argument for a function? (Can't see why my code returns value error)
body: <p>I'm having difficulty getting a function with a collection as its argument to do anything.</p>
  
  <p>I have a function that outputs a collection</p>
  
  <pre><code>function ext(P as string) as collection
  dim serv as new collection
  serv.add P, "1"
  set ext = serv
  end function
  </code></pre>
  
  <p>ive tried to make a second function that takes collections and spits out their first item but it doesn't work</p>
  
  <pre><code>function first (C as collection) as string
  first = C(1)
  end function
  </code></pre>
  
  <p>so when I call</p>
  
  <pre><code>first(ext("Apple"))
  </code></pre>
  
  <p>I should get "Apple"
  but I get a value error.</p>
  
  <p>does anyone know why?</p>