Hi again,
Thanks for that. It solved one of my problems, and got me thinking in a different direction which enabled me to hack something together for the numbering as well, and it ain't pretty but it works.
Attribute__Name %attName%
Attribute__Id $attrNames = %list="Attribute__Name" @separator="#"%
$attrName = %attName%
$attrPos = %FIND($attrNames, $attrName)%
$attrNames = %LEFT($attrNames, $attrPos)%
$attrNames = %TO_UPPER($attrNames)%
$attrNames = %REPLACE($attrNames, "A", "")%
$attrNames = %REPLACE($attrNames, "B", "")%
$attrNames = %REPLACE($attrNames, "C", "")%
... (one for each legal attribute name character)
$attrNames = %REPLACE($attrNames, "8", "")%
$attrNames = %REPLACE($attrNames, "9", "")%
%LENGTH($attrNames)%
The above puts all the attribute names in a #-separated string, then finds the current attribute's name in that string and cuts everything from that position. We're then left with only the names of those attributes preceding the current one in the #-separated string.
Deleting all the legal attribute name characters leaves us with a string with just #'s in it, one for each attribute preceding the current one. The length of this string is the zero-based attribute number.
So it can be done. Please everybody, don't use this code. It's not something I'd care to put my name to. :)