Hi Bee!

On Mi, 30 Sep 2009, Bee wrote:

> How to use something like repeat() to create a string like:
> 
> '" '.(((start at 3 increment by 1) mod 10) for count of 62)
> 
> resulting in:
> 
> " 34567890123456789012345678901234567890123456789012345678901234

fu! Repeat(start, mod, count)
    let i=1
    let s=[]
    call add(s,a:start)
    while i < a:count
        call add(s,(s[i-1]+1)%a:mod)
        let i+=1
    endw
    return join(s, '')
endfu

:echo Repeat(3,10,62)
34567890123456789012345678901234567890123456789012345678901234


regards,
Christian
-- 
"The Mac OS X kernel should never panic because, when it does, it 
seriously inconveniences the user." 
--http://developer.apple.com/technotes/tn2004/tn2118.html 

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to