Sunday, May 22, 2011

Re: question about string expression evaluation / bug?

On 05/22/2011 05:48 PM, hsitz wrote:
> In this Vim installation the expression 'xxx'> '' evaluates to 0
> (false) while in all other Vims I've seen the expression evaluates (as
> it should) to 1 (true).

I confirm that it should eval to 1.

> Is there some Vim setting (encoding?) that might have changed the
> result of this string comparison? It was a plain-jane install of Vim
> (nothing of note in vimrc) giving the bad result, didn't see anwhere a
> setting could have been changed even if there is some setting that
> affects this result.
> --------------------------------------------
> if mystring> ''
> " do something here
> [. . . ]
> endif
> ------------------------------------------

My first questions would be:

1) what *is* in your vimrc?

2) what's the output of ":version"? This might also be checkable
with ":echo 'xxx'>''" to see what it evals as. Depending your
version, you might be running with -eval set. According to
":help no-eval-feature", items in an "if" block get ignored if
your build doesn't include +eval

-tim


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