Friday, November 25, 2011

Re: Backporting script to vim 6.3 (need help)

So then I guess I won't be able to return mulitple arguments. I need
to do some rewriting then... hmmm

In vim6 there are only two types available: string and numbers.

You can use strings to emulate arrays (there is a quite usable library for that but I forgot its name ... genutils maybe? ... not multvals it was). For dictionaries, you could use array whose values match specific patterns ... somehow. :-)

An alternative approach is to pass around strings that define local variables when being executed. E.g.

function! Foo(a)
    return "let val1='foo". escape(a:a, "'") ."'|let val2 ='bar". escape(a:a, "'") ."'"
endf

function! Bar(a)
    exec Foo(a:a)
    echo "Bar" a:a "is" val1 "and" val2
endf

call Bar("lala")

You might want to reconsider updating vim. :-)

Regards

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment