The documentation states:

    *eval.txt*      For Vim version 7.0.  Last change: 2006 May 06
    ... 

    To return more than one value, pass the name of a global variable: >
      :function Compute(n1, n2, divname)
      :  if a:n2 == 0
      :    return "fail"
      :  endif
      :  let g:{a:divname} = a:n1 / a:n2
      :  return "ok"
      :endfunction

    This function can then be called with:
      :let success = Compute(13, 1324, "div")
      :if success == "ok"
      :  echo div
      :endif

    An alternative is to return a command that can be executed.  This also works
    with local variables in a calling function.  Example: >
      :function Foo()
      :  execute Bar()
      :  echo "line " . lnum . " column " . col
      :endfunction

      :function Bar()
      :  return "let lnum = " . line(".") . " | let col = " . col(".")
      :endfunction

    The names "lnum" and "col" could also be passed as argument to Bar(), to 
allow
    the caller to set the names.


Shouldn't be the possibility added to return dicts/ lists?

Marc

Reply via email to