Steve Hall wrote: > Is there a way to construct the code below to avoid the "E193 > :endfunction not inside a function" error in Vim 6.4 when loading a > Vim 7.0 script? > > This for-endfor construct produces the error: > > function! MyFunct() > if v:version < 700 > return > endif > ... > for i in range(tabpagenr('$')) > ... > endfor > endfunction > > The runtime condition is fine, earlier versions avoid the problem. > > I know I can avoid it by silencing :source call but I'd rather not do > that if there's some other trick.
Curious about why you don't negate your test: meaning why not stick the for inside an if v:version >= 700 ? --Suresh