Loading ...
Sorry, an error occurred while loading the content.

for list

Expand Messages
  • Hofmann, Joachim
    Hello, How is the syntax to a for list with constants e.g. let mydb = db1 db2 db3 for db in mydb source db.dict end Thank You Joachim -- You received this
    Message 1 of 4 , Feb 1, 2011
    • 0 Attachment
      Hello,

      How is the syntax to a for list with constants

      e.g.

      let mydb = "db1 db2 db3"
      for db in mydb
      source db.dict
      end


      Thank You
      Joachim

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Israel Chauca F.
      ... let mydb = db1 db2 2b3 for db in split(mydb) exec source .db. .dict end I m not sure what your db.dict is, but what I wrote would source db1.dict,
      Message 2 of 4 , Feb 1, 2011
      • 0 Attachment
        On Feb 1, 2011, at 5:33 AM, Hofmann, Joachim wrote:

        > Hello,
        >
        > How is the syntax to a for list with constants
        >
        > e.g.
        >
        > let mydb = "db1 db2 db3"
        > for db in mydb
        > source db.dict
        > end


        let mydb = "db1 db2 2b3"
        for db in split(mydb)
        exec 'source '.db.'.dict'
        end

        I'm not sure what your db.dict is, but what I wrote would source db1.dict, db2.dict and db3.dict.

        Israel

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Hofmann, Joachim
        ... Yes thank you, I understood the for in list-syntax. That s what I have now: se ic let alledbs = [ bpms_mandant , bpms_regio , bpms_stamm ,
        Message 3 of 4 , Feb 2, 2011
        • 0 Attachment
          >
          > On Feb 1, 2011, at 5:33 AM, Hofmann, Joachim wrote:
          >
          > > Hello,
          > >
          > > How is the syntax to a for list with constants
          > >
          > > e.g.
          > >
          > > let mydb = "db1 db2 db3"
          > > for db in mydb
          > > source db.dict
          > > end
          >
          >
          > let mydb = "db1 db2 2b3"
          > for db in split(mydb)
          > exec 'source '.db.'.dict'
          > end
          >
          > I'm not sure what your db.dict is, but what I wrote would source
          > db1.dict, db2.dict and db3.dict.
          >
          > Israel
          >

          Yes thank you, I understood the for in list-syntax.
          That's what I have now:

          se ic
          let alledbs = ['bpms_mandant', 'bpms_regio', 'bpms_stamm', 'iccs_cbcs_gas_telda', 'iccs_cbcs_stm', 'iccs_cbcs_telda', 'iccs_crm_gas_telda', 'iccs_crm_stm', 'iccs_crm_telda', 'iccs_master_stm', 'iccs_master_telda', 'regio']
          for db in alledbs
          if search('use ' . db, "w") > 0
          echo db . ' found
          else
          echo 'not found'
          endif
          endfor

          What I want at last is:
          Every database db has its own dictionary file.
          Vim should add dict files corresponding to the found USE Databasefoo - line in the buffer.
          e.g. if there is a "USE BPMS_Mandant" in the buffer it indicates the vim should add the dictionary file "BPMS_Mandant.txt" to the dict-option
          And so on.
          If there is no match at all, vim should add all files to the dict-option.


          - Joachkim

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        Your message has been successfully submitted and would be delivered to recipients shortly.