I mean if there is such mechanism in the vim script itself.
OK, maybe the title of this mail is not very clear for you to
understand, i just give an example.
let foo = {}
let foo.var = 100
we can access the value 100 by :
echo foo.var
echo foo['var']
i just want to know if there is a mechanism
On 12-Aug-2010 10:19, winterTTr wrote:
I mean if there is such mechanism in the vim script itself.
OK, maybe the title of this mail is not very clear for you to
understand, i just give an example.
let foo = {}
let foo.var = 100
we can access the value 100 by :
echo foo.var
echo
Hi,
Ingo Karkat wrote:
On 12-Aug-2010 10:19, winterTTr wrote:
Or is there an alternate method to accessing dictionary when the key
is not found
, instead of showing error directly?
You can use
echo get(foo, 'var', MyFunction('var'))
MyFunction() can then return whatever you want
On 12 August 2010 17:01, Jürgen Krämer jottka...@googlemail.com wrote:
Hi,
Ingo Karkat wrote:
On 12-Aug-2010 10:19, winterTTr wrote:
Or is there an alternate method to accessing dictionary when the key
is not found
, instead of showing error directly?
You can use
echo get(foo,
On Aug 12, 4:23 am, winterTTr winterttr@gmail.com wrote:
OK, thanks so much for your answers. I do not notice the get() method.
There is indeed an alternate way to do so. That's great.
However, I must use this code everywhere if i want the feature as i mentioned.
Even the other person
On 12 August 2010 20:34, Ben Fritz fritzophre...@gmail.com wrote:
On Aug 12, 4:23 am, winterTTr winterttr@gmail.com wrote:
OK, thanks so much for your answers. I do not notice the get() method.
There is indeed an alternate way to do so. That's great.
However, I must use this code