definedfields

definedfields — return index of list's defined fields

Calling sequence

k=definedfields(l)    

Parameters

l : a list , tlist or mlist variable.
k : a vector of index.

Description

If l is a listtlistmlistk=definedfields(l) returns in k the indices of the defined list fields. This function is useful because indexing undefined fields produces an error.

Examples



l=list(1);l(3)=5 
k=definedfields(l)

t=tlist('x');t(5)=4
definedfields(t)

m=mlist(['m','a','b']);m.b='sdfgfgd' 
definedfields(m)  
 
  

See also

list , tlist , mlist , insertion, extraction