Tinderbox v9 Icon

Strings vs. StyledStrings in operator documentation

Many dot-operators are intended to work on a literal string, the value of a String-type attribute or an expression resolving to a string. There are a small number of exceptions to this where the operator applies rich text (RTF) styles to its output.

At present, $Text is the only attribute capable of holding such styled text. String attributes and action code variables, i.e. var(), cannot store styled text. If passed styled text the latter will store the un-styled version of the text being passed.

Thus, if we create a styled string and pass it direct to a RTF-capable String type, it works:

$Text = "This is " + "some".strike + " text"; 

The result is a $Text value of a “This is some text”. Also if $MyString is "some":

$Text = "This is " + $MyString.strike + " text"; 

But if we try this:

$MyString = "This is " + "some".strike + " text"; $Text = $MyString; 

…the result is a $Text value of an un-styled “This is some text”. So, a String-type attribute cannot hold styled text. The same is true if a variable is use for hold the result:

var vStr = "This is " + "some".strike + " text"; $Text = vStr; 

…again, the result is a $Text value of an un-styled “This is some text”.



A Tinderbox Reference File : Actions & Rules : Strings vs. StyledStrings in operator documentation