Author Topic: $And / $Or functions  (Read 1759 times)

GbMedusa

  • Newbie
  • *
  • Posts: 2
I'm trying to organize files based on the source (CD, cassette, LP, etc.). However, I've run into a small problem.

When I plug these into the Template Editor, I get an "OK" in validation.
Code
$Contains(<Grouping>,CD)
Code
$Contains(<Grouping>,Cassette)
Code
$Contains(<Grouping>,LP)

Oddly enough, even this gets an "OK".
Code
$Contains(<Grouping>,CD),$Contains(<Grouping>,Cassette),$Contains(<Grouping>,LP)

However, when I try to $And or $Or, I get the message "Fail @ "" " message. So this doesn't work.
Code
$Or($Contains(<Grouping>,CD),$Contains(<Grouping>,Cassette),$Contains(<Grouping>,LP))

Strangely enough,
Code
$Contains(1,2)
does not give an error message while
Code
$Or(1,2)
does.

If anyone can point me in the right direction, I would greatly appreciate it. Thanks.

redwing

  • Guest
$And and $Or connects two if-conditions.
If you want to check more than two conditions, $IsMatch would work better than $Contains which does not support regex.

For instance,

$IsMatch(<Artist>,"Adele|Beck|Beatles")

returns "T" for any tracks of Adele, Beck, or the Beatles, otherwise "F".

GbMedusa

  • Newbie
  • *
  • Posts: 2
Thank you so much. That's what I needed to know.