Wednesday, October 24, 2012

Re: How to check for $ProgramFiles(x86) ?

On Wednesday, October 24, 2012 4:25:41 PM UTC-5, Gary Johnson wrote:
>
> I think the following or a variation should do it. I was only able
> to test it on names without parentheses as I didn't see any variable
> names with them in my environment.
>
> split(system('set ProgramFiles(x86)', '=')[1]
>
> gets the value and
>
> system('set ProgramFiles(x86)') =~ 'not defined'
>
> will evaluate to true if the variable is not defined.
>

Not quite. You get hit by Windows *#$&#ing command-line quoting.

This works for me:

:echo system('set PROGRAMFILES^(x86^)')

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