Wednesday, January 26, 2011

Re: How calling function from filter(dictionary)?

On 26 January 2011 13:51, sgp <acs322000@yahoo.com> wrote:
How can I call a function from filter(dictionary)?

This calls Compare() which then complains about val and tgt being undefined

       let dic=filter(copy(self),'v:key =~ "^pre" ?0 : call("Compare",[v:val, "'.tgt.'"])')
       function! LXcompare(val,tgt) " val can be string or List
               echo tgt 
               echo val

You need to use a:tgt and a:val.  See :help a:var for details.
 
               return 0
       endfunction

TIA

--
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



--
John Tobin
BCD SRE

--
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: