Hello All,

When using dbext module to run an sql statement, the result is in a
'Result' buffer. I'd like to capture the first 10 lines from the
result buffer and append them to a file. Here is what I tried, It runs
with no error but returns empty result:

function! DBextPostResult(db_type, buf_nr)
   "--Desc: Append top 10 lines in dbext result window into a file

   "--get top 10 lines from result window. THIS RETURNS EMPTY!
   let topLines = getbufline(a:buf_nr,1,min([10,line("$")]))
   "let topLines = getbufline(a:buf_nr,1,10)

   "echo "post result: buf_nr:" a:buf_nr " toplines:" topLines

   "--append to a file
   redir >> c:\temp\dbext.result | silent echo join(topLines,"\n") |
redir END

endf

The function itself works if I test it line by line while in Result
window.

I appreciate any input,

Ying Chen


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

Reply via email to