# Logical/Maths Operators not Working

**URL:** <https://community.mp3tag.de/t/logical-maths-operators-not-working/60699>\
**Category:** Support\
**Created:** [April 13, 2023, 6:36am UTC](https://community.mp3tag.de/t/logical-maths-operators-not-working/60699 "2023-04-13T06:36:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dec](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dec/32/13699_2.png) [@dec](https://community.mp3tag.de/u/dec)\
**Post date:** [April 13, 2023, 6:36am UTC](https://community.mp3tag.de/t/logical-maths-operators-not-working/60699/1 "2023-04-13T06:36:33Z")

</div>

the problem was this

$if(%year%=0 .... simply did not work. it evaluated TRUE for every record. btw, this was literal '0's, not nulls.

i tried all sorts of different variations, but none of them actuallly worked as expected

eventually I gave up and did a work-around instead

but i would still like to know why it didn't work

by the way, i have solved all other fixes/problems, often with my great app Bulk Renamer Utility to help a lot - albeit for File Name only

---

<div class="post-metadata">

**Author:** ![dec](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dec/32/13699_2.png) [@dec](https://community.mp3tag.de/u/dec)\
**Post date:** [April 13, 2023, 6:37am UTC](https://community.mp3tag.de/t/logical-maths-operators-not-working/60699/2 "2023-04-13T06:37:41Z")

</div>

btw, are variables case-sensitive? eg in above is Year == year?

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [April 13, 2023, 7:45am UTC](https://community.mp3tag.de/t/logical-maths-operators-not-working/60699/3 "2023-04-13T07:45:24Z")

</div>

> [@dec](#):
>
> the problem was this
> 
> $if(%year%=0 .... simply did not work. it evaluated TRUE for every record. btw, this was literal '0's, not nulls.

This does not match the MP3tag syntax. there is no comparator `=`. You would have to use $eql().  
See here:

> **[Scripting Functions – Mp3tag Documentation](https://docs.mp3tag.de/scripting/#boolean-functions)**
>
> Documentation on Mp3tag's scripting functions. Mp3tag is the universal Tag Editor.

You could have tried `$if($eql(%year%,0),yes,no)`

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [April 13, 2023, 7:51am UTC](https://community.mp3tag.de/t/logical-maths-operators-not-working/60699/4 "2023-04-13T07:51:54Z")

</div>

> [@dec](#):
>
> variables case-sensitive

No, they are not. case-sensitive

---

<div class="post-metadata">

**Author:** ![dec](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dec/32/13699_2.png) [@dec](https://community.mp3tag.de/u/dec)\
**Post date:** [April 13, 2023, 9:01am UTC](https://community.mp3tag.de/t/logical-maths-operators-not-working/60699/5 "2023-04-13T09:01:48Z")

</div>

ah!  
hmmm. so no normal maths/logical operators?  
ok, but very unusual.  
but once you know, you can dfo as above as you suggest (with approp string reults)

many thanks

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [May 13, 2023, 9:02am UTC](https://community.mp3tag.de/t/logical-maths-operators-not-working/60699/6 "2023-05-13T09:02:40Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
