comparison runtime/doc/eval.txt @ 7707:41768bcebc9b

commit https://github.com/vim/vim/commit/13d5aeef56e3140a8eb8f40c7062aa1c5700f76e Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 21 23:36:05 2016 +0100 Update runtime files
author Christian Brabandt <cb@256bit.org>
date Thu, 21 Jan 2016 23:45:07 +0100
parents 39251e981d1f
children bce3b5ddb393
comparison
equal deleted inserted replaced
7706:dd457970efc8 7707:41768bcebc9b
1 *eval.txt* For Vim version 7.4. Last change: 2016 Jan 17 1 *eval.txt* For Vim version 7.4. Last change: 2016 Jan 21
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
100 100
101 *E805* *E806* *E808* 101 *E805* *E806* *E808*
102 When mixing Number and Float the Number is converted to Float. Otherwise 102 When mixing Number and Float the Number is converted to Float. Otherwise
103 there is no automatic conversion of Float. You can use str2float() for String 103 there is no automatic conversion of Float. You can use str2float() for String
104 to Float, printf() for Float to String and float2nr() for Float to Number. 104 to Float, printf() for Float to String and float2nr() for Float to Number.
105
106 *E891* *E892* *E893* *E894*
107 When expecting a Float a Number can also be used, but nothing else.
105 108
106 *E706* *sticky-type-checking* 109 *E706* *sticky-type-checking*
107 You will get an error if you try to change the type of a variable. You need 110 You will get an error if you try to change the type of a variable. You need
108 to |:unlet| it first to avoid this error. String and Number are considered 111 to |:unlet| it first to avoid this error. String and Number are considered
109 equivalent though, as well are Float and Number. Consider this sequence of 112 equivalent though, as well are Float and Number. Consider this sequence of
3599 All other "other" 3602 All other "other"
3600 Example: > 3603 Example: >
3601 getftype("/home") 3604 getftype("/home")
3602 < Note that a type such as "link" will only be returned on 3605 < Note that a type such as "link" will only be returned on
3603 systems that support it. On some systems only "dir" and 3606 systems that support it. On some systems only "dir" and
3604 "file" are returned. 3607 "file" are returned. On MS-Windows a symbolic link to a
3608 directory returns "dir" instead of "link".
3605 3609
3606 *getline()* 3610 *getline()*
3607 getline({lnum} [, {end}]) 3611 getline({lnum} [, {end}])
3608 Without {end} the result is a String, which is line {lnum} 3612 Without {end} the result is a String, which is line {lnum}
3609 from the current buffer. Example: > 3613 from the current buffer. Example: >
5890 Funcrefs will be considered as being 0). 5894 Funcrefs will be considered as being 0).
5891 5895
5892 When {func} is given and it is 'N' then all items will be 5896 When {func} is given and it is 'N' then all items will be
5893 sorted numerical. This is like 'n' but a string containing 5897 sorted numerical. This is like 'n' but a string containing
5894 digits will be used as the number they represent. 5898 digits will be used as the number they represent.
5899
5900 When {func} is given and it is 'f' then all items will be
5901 sorted numerical. All values must be a Number or a Float.
5895 5902
5896 When {func} is a |Funcref| or a function name, this function 5903 When {func} is a |Funcref| or a function name, this function
5897 is called to compare items. The function is invoked with two 5904 is called to compare items. The function is invoked with two
5898 items as argument and must return zero if they are equal, 1 or 5905 items as argument and must return zero if they are equal, 1 or
5899 bigger if the first one sorts after the second one, -1 or 5906 bigger if the first one sorts after the second one, -1 or