Wednesday, December 23, 2009

Mapping only fields of a Dictionnary (help says only List and all items of Dict)

Hi,

I am building some info in Dict and hash like this :
------------------------------------
let myHash = {}

let g:cnt = 1
g/pattern/=call storingData()/

func! storingData(param1, param2)

let myHash[g:cnt] = {'information':a:param1 , 'clue':a:param2 }

let g:cnt += 1
endfunc
-------------------------

I would like to know if I can map only the field of a dictionnary: eg
information below
Furthermore, I would like to map differently my two fields
"information" and "clue"

Can we do that ?
map(copy(values(myHash).information,"PREFIX_BARTEXT v:val
SUFFIX_BARTEXT")
map(copy(values(myHash).clue," v:val SUFFIX_FOOTEXT")


Thanks

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

No comments:

Post a Comment