Hello,
An odd problem. multiple duplicate displayed attributes are getting created in notes.
I have action code which displays and sets an attribute (in agents, and in Stamps in various places), in the following format.
$DisplayedAttributes=$DisplayedAttributes + “Tags”;
($Tags is just and example, it happens with any attribute)
I thought this was the way to add a displayed attribute without hiding the existing ones, but it creates duplicates.
this seems to be since v9.
I tried the new += way of adding, and it does the same thing…
Any help appreciated.
Best
Thomas
$DisplayedAttributes in v9.0.0+ is List type. Prior to v9 it was a Set. But as Sets now actively re-sort themselves, and the user needs to be able to control the Displayed Attributes list order, the attribute needs to be a List.
A notable difference between Lists and Sets is that Sets de-dupe themselves and Lists don’t. So a List can contain the same value more than once. This is expected behaviour
$DisplayedAttributes’s default value is nothing, i.e. "". Now let’s use the stamp (or a rule, edict or agent action) to apply this code:
$DisplayedAttributes is a List and we’ve added 3 more thinfs to it. So as we’ve instructed it the attribute now displays the $Tags attribute 4 times, as the $ Displayed Attributes attribute value is “Tags;Tags;Tags;Tags”: