# \[F\] $meta() values lack meaning inside $if()

**URL:** https://community.mp3tag.de/t/f-meta-values-lack-meaning-inside-if/12113
**Category:** Fixed Bugs
**Tags:** bug-fixed
**Created:** [June 7, 2011, 3:32pm UTC](https://community.mp3tag.de/t/f-meta-values-lack-meaning-inside-if/12113 "2011-06-07T15:32:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ptrk.mj](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ptrk.mj/32/300_2.png) [@ptrk.mj](https://community.mp3tag.de/u/ptrk.mj)
#### Post date: [June 7, 2011, 3:32pm UTC](https://community.mp3tag.de/t/f-meta-values-lack-meaning-inside-if/12113/1 "2011-06-07T15:32:47Z")

</div>

I will explain this one with an example.

Supposing artist field exists:

```
$if2($meta(artist),no artist)

```

returns no artist in Mp3tag  
returns value of $meta(artist) in foobar2000

It makes writing scripts more difficult.  
In my view, this should be made to work as in foobar.

---

<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: [June 7, 2011, 4:09pm UTC](https://community.mp3tag.de/t/f-meta-values-lack-meaning-inside-if/12113/2 "2011-06-07T16:09:51Z")

</div>

> [@ptrk.mj](#):
>
> ... $if2($meta(artist),no artist)  
> returns no artist in Mp3tag  
> returns value of $meta(artist) in foobar2000
> 
> It makes writing scripts more difficult.  
> In my view, this should be made to work as in foobar.

Can be written as ...  
... boolean ...  
$iflonger($meta(artist),,1,0)  
... string ...  
$iflonger($meta(artist),,$meta(artist),)

To tweak $if2 to expose the same behaviour when its argument is a text string output from $meta rather than a tag-field resp. tag-field content, there might be done some programming hard work to do.

DD.20110607.2010.CEST

---

<div class="post-metadata">

### Author: ![ptrk.mj](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ptrk.mj/32/300_2.png) [@ptrk.mj](https://community.mp3tag.de/u/ptrk.mj)
#### Post date: [June 7, 2011, 6:01pm UTC](https://community.mp3tag.de/t/f-meta-values-lack-meaning-inside-if/12113/3 "2011-06-07T18:01:03Z")

</div>

> [@DetlevD](#):
>
> Can be written as ...

Yes, it's not irreplaceable. Personally, I use $if(%artist%,$meta(artist),)

> [@DetlevD](#):
>
> there might be done some programming hard work to do.

foobar2000 is closed source so there's probably no option to get it from there (?)

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [December 28, 2018, 2:05pm UTC](https://community.mp3tag.de/t/f-meta-values-lack-meaning-inside-if/12113/4 "2018-12-28T14:05:21Z")

</div>

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