kshenoy
kshenoy

Reputation: 1826

Vim E488: Trailing Characters in function

I'm getting a trailing characters error for the 'for loop' in the following lines of code and I've no clue why.

function! s:HashID(str)  "{{{
    let l:hash_id = 0
    for i in split(a:str, '\zs')
        l:hash_id += float2nr(pow(2, stridx('abcdefg', i)))
    endfor
    return l:hash_id
endfunction

What am I goofing up here?

Upvotes: 2

Views: 1641

Answers (1)

kev
kev

Reputation: 161964

You need let command to assign value to variable.

Upvotes: 3

Related Questions