INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Expression help: "Fake" Right Justification  (Read 951 times)

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2650
Expression help: "Fake" Right Justification
« on: October 25, 2011, 01:03:46 am »

I am trying to "fake" right-justify my rating stars in theater view. Unfortunately there is no expression to:

Print( ,Math(30 - (Length([Name]))) if you catch my drift.

The only solution I could come up with was to create a library field (Justify) with a value of "                                                        " for all files and then do a RemoveRight([Justify],(Length([Name]))) in my theater view:

Code: [Select]
If(isequal([Media Type],Audio,1),[Name]RemoveRight([Justify],Length([Name]))[Rating.Display],If(isequal([Media Sub Type],TV Show,1),[Episode] [Name] [Date],[Name] /([Year]/)))
However, Length() does not seem to include spaces, so I included the RemoveCharacters() function:

Code: [Select]
If(isequal([Media Type],Audio,1),[Name]RemoveRight([Justify],Length(RemoveCharacters([Name], )))[Rating.Display],If(isequal([Media Sub Type],TV Show,1),[Episode] [Name] [Date],[Name] /([Year]/)))
However, the RemoveCharacters doesn't seem to remove spaces.

Next, I tried the Replace function:

Code: [Select]
If(isequal([Media Type],Audio,1),[Name]RemoveRight([Justify],Length(Replace([Name], ,)))[Rating.Display],If(isequal([Media Sub Type],TV Show,1),[Episode] [Name] [Date],[Name] /([Year]/)))
Still no go. Pulling my hair out!

Edit: I've also tried adding the leading "/" in front of the spaces, in both the Justify field and the expression:

Code: [Select]
If(isequal([Media Type],Audio,1),[Name]RemoveRight([Justify],Length(Replace([Name],/ ,)))[Rating.Display],If(isequal([Media Sub Type],TV Show,1),[Episode] [Name] [Date],[Name] /([Year]/)))
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Expression help: "Fake" Right Justification
« Reply #1 on: April 10, 2012, 12:47:36 pm »

For future reference and posting, see this thread:

   http://yabb.jriver.com/interact/index.php?topic=71411.0
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up