question

martin.j avatar image
0 Likes"
martin.j asked Matthew Gillespie commented

Number of labels & labels by numeric reference

With the new dot syntax for labels it has become pretty easy to access a label by name, but is it still possible to access it by number? If I want to get the last label on an item, I would have to know how many labels the item has in total and be able to use that as the index.

But apparently the LabelsArray datatype does not support the Length property nor will it accept anything other than a string name. It doesn't seem to be possible to get a label by its index unless I use the deprecated getlabels functions.

So how can I get the total number of labels on an object?

And how can I access the label with its index?

labelsdot syntax
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Joerg Vogel avatar image
2 Likes"
Joerg Vogel answered Matthew Gillespie commented

You mean this

  1. obj.attrs.labels.subnodes[num rank]

?


· 6
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.