Skip to main content
Topic: Scripting: how to hide strings (Read 1893 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Scripting: how to hide strings

Hi all. In a "Dockable Panels", I create this Track Info mod:

Code: [Select]
$if(%_trackinfo_notrack%,No track,
Title: %title%$char(10)Album: %album%)$char(10)
Album: %ORIGINAL ALBUM%  '('%ORIGINAL RELEASE DATE%')'$char(10)
Music: %COMPOSER%$char(10)
Lyrics: %WRITER%$char(10)
Publisher: %PUBLISHER%$char(10)
Comment: %Comment%


The problem is when a tag is empty, I get this output:
--------------------------
Title: bla bla
Album: bla bla
Music: ?
Lyrics: ?
Publisher: bla bla
Comment: ?
--------------------------
That is, it shows a '?' character in fields without relative tags.

Can I get a output that hide fields empty (in this manner):
-----------------------
Title: bla bla
Album: bla bla
Publisher: bla bla
-----------------------
(in pseudo-code: if tag is empty, then do not show relative field)

Thanks in advance.

Scripting: how to hide strings

Reply #1
There are two easy ways to do this. Either encapsulate your tag in brackets or place it inside an $if2() statement. For example change %ALBUM% to either [%ALBUM%] or $if2(%ALBUM%,)

Scripting: how to hide strings

Reply #2
Thanks, Yotsuya.

I trying your directions, and now '?' character is hidden. But is it possible to hidden the string "Album" too?

Scripting: how to hide strings

Reply #3
Just include the "Album" in the same brackets:
[Album: %ORIGINAL ALBUM%  '('%ORIGINAL RELEASE DATE%')'$char(10)]

 

Scripting: how to hide strings

Reply #4
Hi Hakubo.
Quote
Just include the "Album" in the same brackets:
[Album: %ORIGINAL ALBUM% '('%ORIGINAL RELEASE DATE%')'$char(10)]

Oh, Perfect! 
It was so easy... 

Bye, conax.

 
SimplePortal 1.0.0 RC1 © 2008-2019