# Need help with a not working code

**URL:** https://community.mp3tag.de/t/need-help-with-a-not-working-code/19200
**Category:** Support
**Created:** [August 6, 2017, 10:04am UTC](https://community.mp3tag.de/t/need-help-with-a-not-working-code/19200 "2017-08-06T10:04:23Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [August 6, 2017, 10:04am UTC](https://community.mp3tag.de/t/need-help-with-a-not-working-code/19200/1 "2017-08-06T10:04:23Z")

</div>

I would like to request evaluation of my code that I wrote for a column

```
$if(%ALBUM%, $if($strchr(%ALBUM%,|)'+ OK +','- DISCS'),'')

```

And here is what it is suppose to do: search for the sign \>\>|\<\< in ALBUM tag field and display \>\>+ OK +\<\< if it is there or display \>\>- DISCS\<\< if it is not there; and if the whole ALBUM tag field is simply empty, then display nothing

Right now I get the INVALID $IF SYNTAX error

---

<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: [August 6, 2017, 10:09am UTC](https://community.mp3tag.de/t/need-help-with-a-not-working-code/19200/2 "2017-08-06T10:09:12Z")

</div>

The help on the $IF statement says:

$if(x,y,z) if x is true, y is returned, otherwise z.

I cannot see that syntax represented in your expression.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [August 6, 2017, 11:10am UTC](https://community.mp3tag.de/t/need-help-with-a-not-working-code/19200/3 "2017-08-06T11:10:13Z")

</div>

> [@Zerow](#):
>
> I would like to request evaluation of my code that I wrote for a column ...

This works ...

**$if(%ALBUM%,$ifgreater($strstr(%ALBUM%,'|'),0,'+ OK +','- DISCS'),)**

DD.20170806.1510.CEST

---

<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: [August 6, 2017, 12:34pm UTC](https://community.mp3tag.de/t/need-help-with-a-not-working-code/19200/4 "2017-08-06T12:34:43Z")

</div>

> [@Zerow](#):
>
> I would like to request evaluation of my code that I wrote for a column
> 
> ```
> $if(%ALBUM%, $if($strchr(%ALBUM%,|)'+ OK +','- DISCS'),'')
> 
> ```
> 
> And here is what it is suppose to do: search for the sign \>\>|\<\< in ALBUM tag field and display \>\>+ OK +\<\< if it is there or display \>\>- DISCS\<\< if it is not there; and if the whole ALBUM tag field is simply empty, then display nothing
> 
> Right now I get the INVALID $IF SYNTAX error

You got examples for a working $IF syntax in one of your earlier posts from 2017, e.g.  
[/t/18676/1](https://community.mp3tag.de/t/18676/1)

why didn't you use that template?

---

<div class="post-metadata">

### Author: ![Zerow](https://community.mp3tag.de/user_avatar/community.mp3tag.de/zerow/32/11379_2.png) [@Zerow](https://community.mp3tag.de/u/Zerow)
#### Post date: [August 6, 2017, 4:47pm UTC](https://community.mp3tag.de/t/need-help-with-a-not-working-code/19200/5 "2017-08-06T16:47:36Z")

</div>

> [@DetlevD](#):
>
> This works ...  
> $if(%ALBUM%,$ifgreater($strstr(%ALBUM%,'|'),0,'+ OK +','- DISCS'),)

Yes, it does

Thank you very much

> [@ohrenkino](#):
>
> You got examples for a working $IF syntax in one of your earlier posts from 2017, e.g.  
> [/t/18676/1](https://community.mp3tag.de/t/18676/1)
> 
> why didn't you use that template?

I did look at what I already have and use- and thus found some other codes with which I tempered a bit. And then I tried finding what I lacked at [https://docs.mp3tag.de/scripting](https://docs.mp3tag.de/scripting)

And only then did I went to the forum, presenting with what I came up to believe was the closest that I could get on my own

Do not think I do not appreciate the time that is required to help the likes of me on this forum or that I do not try to learn something useful also outside the Mp3tag when spending so much time with it

---

<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: [February 9, 2026, 12:26pm UTC](https://community.mp3tag.de/t/need-help-with-a-not-working-code/19200/6 "2026-02-09T12:26:55Z")

</div>


