Thursday, April 23, 2015

Re: Build amenu from Funcref

On Wednesday, April 22, 2015 at 3:54:27 PM UTC+1, Ni Va wrote:
> On Wednesday, April 22, 2015 at 3:03:41 PM UTC+1, Ben Fritz wrote:
> > On Wednesday, April 22, 2015 at 4:03:07 AM UTC-5, Ni Va wrote:
> > > Hi all,
> > >
> > > I got some scriptPsexec#function('ddddd') to refer to but I don't happen to call it :
> > > 1- directly
> > > 2- mapped into amenu command
> > >
> > >
> > > let m = psexec#machine()
> > > call m.configure(machine,cce,level)
> > > for foo in m.getCmdList()
> > > let Fn = copy(m[foo])
> > > "1- exe funcref#Call( Fn )
> > > "2-exe 'anoremenu '.m.getMenuPath().'.'.foo.' :funcref#Call("'.string(Fn).'")<CR>'
> > > endfor
> > >
> > >
> > > The funcref#Call echoes me an error:
> > > E492: unknown command: call funcref#Call("function('3210')")
> > >
> > > Can you help me to call correctly the funcref please ?
> > > Thank you
> >
> > Are you sure that's the exact error message? I don't see a "call funcref#Call" anywhere in your script, and it looks like that would be the fix you need. I.e. rather than "exe funcref..." you need "call funcref...".
>
> Ok with these line code
>
> "1- call funcref#Call(Fn )
> "2- exe 'anoremenu '.m.getMenuPath().'.'.foo.' :call funcref#Call("'.string(Fn).'")<CR>'
>
> 1- The first one call the func.
> 2- The second one display call funcref#Call('21446')
> no error message effectively but I would like to execute the func ref 21446


Even if I replace call by exe, the func is not called by pressing button on my toolbar's menu.

exe 'anoremenu '.m.getMenuPath().'.'.foo.' :call funcref#Call("'.string(Fn).'")<CR>'

replaced by

exe 'anoremenu '.m.getMenuPath().'.'.foo.' :exe funcref#Call("'.string(Fn).'")<CR>'

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: