*eval.txt* For Vim version 5.4. Last change: 1999 Jul 09 VIM REFERENCE MANUAL by Bram Moolenaar Expression evaluation *expression* *expr* Note: Expression evaluation can be disabled at compile time. If this has been
done, the features in this document are not available. See |+eval| and the
last chapter below. 1. Variables |variables|
2. Expression syntax    |expression-syntax|
3. Internal variable    |internal-variables|
4. Builtin Functions    |functions|
5. Defining functions   |user-functions|
6. Commands |expression-commands|
7. Examples |eval-examples|
8. No +eval feature    |no-eval-feature| {Vi does not have any of these commands} ============================================================================== 1. Variables *variables* There are two types of variables: Number a 32 bit signed number.
String a NUL terminated string of 8-bit unsigned characters. These are converted automatically, depending on how they are used. Conversion from a Number to a String is by making the ASCII representation of
the Number. Examples:
     Number 123      -->  String "123"
     Number 0        -->  String "0"
     Number -1       -->  String "-1" Conversion from a String to a Number is done by converting the first digits
to a number. Hexadecimal "0xf9" and Octal "017" numbers are recognized. If
the String doesn't start with digits, the result is zero. Examples:
     String "456"  -->  Number 456
     String "6bar" -->  Number 6
     String "foo"  -->  Number 0
     String "0xf1" -->  Number 241
     String "0100" -->  Number 64 To force conversion from String to Number, add zero to it:
     :echo "0100" + 0 For boolean operators Numbers are used. Zero is FALSE, non-zero is TRUE. Note that in the command :if "foo"
"foo" is converted to 0, which means FALSE. To test for a non-empty string,
use strlen(): :if strlen("foo") When the '!' flag is included in the 'viminfo' option, global variables that
start with an uppercase letter, and don't contain a lowercase letter, are
stored in the viminfo file |viminfo-file|. When the 'sessionoptions' option contains "global", global variables that
start with an uppercase letter and contain at least one lowercase letter are
stored in the session file |session-file|. variable name can be stored where 
my_var_6 not
My_Var_6 session file
MY_VAR_6 viminfo file ============================================================================== 2. Expression syntax *expression-syntax* Expression syntax summary, from least to most significant: |expr1|   expr2 || expr2 ..     logical OR |expr2| expr3 && expr3 ..     logical AND |expr3|        expr4 == expr4 equal expr4 != expr4 not equal expr4 > expr4 greater than expr4 >= expr4 greater than or equal expr4 < expr4 smaller than expr4