getmusicbee.com

Support => Questions => Topic started by: jonap on April 25, 2022, 01:15:26 PM

Title: Naming template help: how to say "if tag1, tag2 and tag3 are all null, then do?
Post by: jonap on April 25, 2022, 01:15:26 PM
It's probably a stupid question but I can't seem to make it work

There is $IsNull, and there is $And, but I can't make it work together

$If($And($IsNull(<tag1>),$IsNull(<tag2>),$IsNull(<tag3>)), <do something>)

this would be my attempt, but it doesn't work
Title: Re: Naming template help: how to say "if tag1, tag2 and tag3 are all null, then do?
Post by: Mayibongwe on April 25, 2022, 03:18:44 PM
This is how I would do it. I think both of these methods do the same thing.

1. $If($And(<tag1>="",<tag2>="",<tag3>=""),do this,do that)

2. $IsNull(<tag1>,$IsNull(<tag2>,$IsNull(<tag3>,do this, do that), do that),do that) (see the post below for a simplified version)

Edit: The "do this" in my examples represents the true value of the statements. The "do that" represents the false part.
         Also have a look here to see how these functions are supposed to work: https://getmusicbee.com/forum/index.php?topic=35868.0
Title: Re: Naming template help: how to say "if tag1, tag2 and tag3 are all null, then do?
Post by: hiccup on April 25, 2022, 03:45:45 PM
This should work too:
$IsNull(<tag1><tag2><tag3>,do something, do something else)
Title: Re: Naming template help: how to say "if tag1, tag2 and tag3 are all null, then do?
Post by: jonap on April 25, 2022, 03:55:15 PM
thanks guys, they both work (hiccup's and #1 of Mayibongwe )

#2 is not really suitable cause I have a long "do that" and repeating it 3 times would make a mess
Title: Re: Naming template help: how to say "if tag1, tag2 and tag3 are all null, then do?
Post by: Mayibongwe on April 25, 2022, 03:59:37 PM
Even better. Thanks hiccup.
(On that thread of yours that I linked, the IsNull example appears to be missing a closing tag for album)

@jonap
I agree. The 2nd has been scratched out.
Title: Re: Naming template help: how to say "if tag1, tag2 and tag3 are all null, then do?
Post by: hiccup on April 25, 2022, 04:08:21 PM
(On that thread of yours that I linked, the IsNull example appears to be missing a closing tag for album)
Thnx, fixed.