Sunday, November 24, 2013

Re: vim rpn calculator

On Sunday, November 24, 2013 2:20:04 PM UTC-8, ZyX wrote:
> On Nov 25, 2013 2:14 AM, "Bee" <fo...@calcentral.com> wrote:
> > From (linux or mac) vim I can use 'dc' a command line rpn calculator as:
> > :!dc '-e 5 5 + 3 * p'
> > It prints the result on the command line... THEN returns to vim.
> > How do I return the value to vim?
>
> system() or :read!. Guess first is more convenient.

Thank you, this works:

:let calc = system("dc '-e 5 5 + 9 * p'")

I will put something like it into a function.

--
--
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/groups/opt_out.

No comments:

Post a Comment