Tinderbox Forum

$Name max length attribute?

Is there an attribute to set the maximum string length in $Name?

For example
$Name == “1234 abcdef 9012345 ghijk”

setting the imaginary $NameMaxLength (if one exists?) attribute to 15 would yield
1234 abcdef 901

Thanks in advance
Tom

There is no attribute as such, but you could use this action code (as stamp or edict) to trime $Name to the first 15 characters:

$Name = $Name.substr(0,15);

In addition to the truncation action that @mwra described, which is permanent, if all you want to do is reduce the length of $Name in a view but not alter the contents of $Name, then use a $DisplayExpression (for info and tips see more here).

So, for example, if $DisplayExpression is set to the right side of the action @mwra posted above, then you’ll see the reduced-length Name but the actual content of the $Name attribute is untouched. I find this useful when watched files, or imports, or exploded notes sometimes makes Name too long.

1 Like

That worked. Thank you to you both. Thanks Paul for the additional comment regarding Display Expressions which is non permanent.

Tom