# question regarding $if behavior in export (v2.41)

**URL:** https://community.mp3tag.de/t/question-regarding-if-behavior-in-export-v2-41/6775
**Category:** Support
**Created:** [May 9, 2008, 2:39pm UTC](https://community.mp3tag.de/t/question-regarding-if-behavior-in-export-v2-41/6775 "2008-05-09T14:39:07Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mp3me](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/a183cd/32.png) [@mp3me](https://community.mp3tag.de/u/mp3me)
#### Post date: [May 9, 2008, 2:39pm UTC](https://community.mp3tag.de/t/question-regarding-if-behavior-in-export-v2-41/6775/1 "2008-05-09T14:39:07Z")

</div>

in my mte file I have this

$put(x,%artist%)  
$if($strcmp($get(x),Various Artists),$put(x,hhhhhh),not equal)  
$get(x)

$put(x,%artist%)  
$if($eql($get(x),Various Artists),$put(x,hhhhhh),not equal)  
$get(x)

in my output html file I have this

10,000 Maniacs  
not equal  
hhhhhh

10,000 Maniacs  
not equal  
hhhhhh

Is this the expected behavior of $if()

---

<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: [May 9, 2008, 3:06pm UTC](https://community.mp3tag.de/t/question-regarding-if-behavior-in-export-v2-41/6775/2 "2008-05-09T15:06:08Z")

</div>

> [@mp3me](#):
>
> ... Is this the expected behavior of $if()

$put() cannot be an argument within another Mp3tag function call.  
You have to change the expression to something like this:  
$put(x,$if(condition,yes-case,no-case))

DD.20080509.1906.CEST

---

<div class="post-metadata">

### Author: ![mp3me](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/a183cd/32.png) [@mp3me](https://community.mp3tag.de/u/mp3me)
#### Post date: [May 9, 2008, 3:07pm UTC](https://community.mp3tag.de/t/question-regarding-if-behavior-in-export-v2-41/6775/3 "2008-05-09T15:07:21Z")

</div>

just tried this

$put(x,%artist%)  
$if($jjjjjjjjjj($get(x),Various Artists),$put(x,hhhhhh)equal,not equal)  
$get(x)

and got the same behavior so apparently neither $if nor $strcmp are supported in export environment?

Where is this stuff documented?

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [May 13, 2008, 5:32pm UTC](https://community.mp3tag.de/t/question-regarding-if-behavior-in-export-v2-41/6775/4 "2008-05-13T17:32:33Z")

</div>

mp3me, I have found $put just fails to work in certain scripting contexts. I've coded around the need to use it wherever possible.

> [@](#):
>
> Where is this stuff documented?

Nowhere I've found. The best available is the incomplete Help, Mp3tag usage, Scripting functions .

---

<div class="post-metadata">

### Author: ![aml](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/ce73a5/32.png) [@aml](https://community.mp3tag.de/u/aml)
#### Post date: [June 9, 2008, 4:14pm UTC](https://community.mp3tag.de/t/question-regarding-if-behavior-in-export-v2-41/6775/5 "2008-06-09T16:14:24Z")

</div>

You could try the following, or some variation of it that applies to what you want.  
When dealing with "Various Artists" I use "Various Artists: Genre" in %band% (Album Artist) and the artists playing the song in %artist%  
So, when using this, I just compare whether the first 7 letters of %band% are equal to "Various" or not, and if so, I use that field. Otherwise, I use %artist%

Various - Year Y - Album X  
or  
Artist - Year Y - Album X

$filename(txt)$loop(%album%,1)  
$if($eql($left(%band%,7),Various),%band%|%year%|%album%,%artist%|%year%|%album%)  
$loopend()

---

<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:20pm UTC](https://community.mp3tag.de/t/question-regarding-if-behavior-in-export-v2-41/6775/6 "2026-02-09T12:20:56Z")

</div>


