Author Topic: Naming template help: how to say "if tag1, tag2 and tag3 are all null, then do?  (Read 405 times)

jonap

  • Jr. Member
  • **
  • Posts: 94
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

Mayibongwe

  • Hero Member
  • *****
  • Posts: 513
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
Last Edit: April 25, 2022, 03:53:11 PM by Mayibongwe

hiccup

  • Hero Member
  • *****
  • Posts: 6382
This should work too:
$IsNull(<tag1><tag2><tag3>,do something, do something else)

jonap

  • Jr. Member
  • **
  • Posts: 94
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

Mayibongwe

  • Hero Member
  • *****
  • Posts: 513
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.

hiccup

  • Hero Member
  • *****
  • Posts: 6382
(On that thread of yours that I linked, the IsNull example appears to be missing a closing tag for album)
Thnx, fixed.