Tinderbox Forum

DisplayExpression - expected left-to-right display, but comes out right-to-left

Hi,

just stumbled across a curious issue.

  1. Opened a new (clean) TB document.
  2. Inserted Reference-Prototypes.
  3. Added a new note in Outline View and set its prototype to “Reference”.
  4. Entered “Tangredi, Sam J.” for $Authors.
  5. Entered “Anti-Access Warfare. Countering A2/AD-strategies” for $BookTitle.
  6. Entered the following DisplayExpression: $Authors+$BookTitle.
  7. Expected to see: Tangredi, Sam J.;Anti-Access Warfare. Countering A2/AD-strategies.
  8. But it says: Anti-Access Warfare. Countering A2/AD-strategies;Tangredi, Sam J.

I wonder where my mistake is. It works as supposed with different $Authors and $BookTitle, though.

Update: It appears that the : -symbol in the titles causes this effect. Just happended with another $BookTitle again.

Since $Authors is a set, the addition means, “Add the book title to the authors.” Sets control their sequence, so you can’t determine whether the name or the title comes first.

One trick to avoid this is to coerce $Authors to a string: ( $Authors.format(" “)). Now, you surely want to add some way to separate the title and the author: ` ( $Authors.format(” “))+” "+$BookTitle.

Another approach would be to build a string variable in a rule or edict, and then use the display expression to show the constructed string.

You might also want to think about using columns.

Wow,

that was fast. Thank you!

I was not aware that $Authors is a set. Will use your approach of using .format.

The separation between Author and Title is obvious; I did not do it for this example to save some typing on my part … :smiley: