# \[X\] '$put or $puts in $if' bug

**URL:** https://community.mp3tag.de/t/x-put-or-puts-in-if-bug/5352
**Category:** No Bugs
**Created:** [August 26, 2007, 6:01am UTC](https://community.mp3tag.de/t/x-put-or-puts-in-if-bug/5352 "2007-08-26T06:01:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Stevest](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/a698b9/32.png) [@Stevest](https://community.mp3tag.de/u/Stevest)
#### Post date: [August 26, 2007, 6:01am UTC](https://community.mp3tag.de/t/x-put-or-puts-in-if-bug/5352/1 "2007-08-26T06:01:18Z")

</div>

Hi,

I've found a bug in MP3Tag v2.39 (and it remains in v2.39a) export.  
If I put a $put or $puts command in the second or third place (in place of 'do if true', 'do if false') in an $if statement, the command will be executed independently of my conditions.

Here is a stupid example, run it some audio files having fields ARTIST and TRACK:

$filename(test.txt)$loop($num(%track%,2))  
$num(%track%,2)  
$if(%artist%,Artist OK,$put(ctr,$num(%track%,2) no artist))  
%artist% - $get(ctr)  
$loopend()

As you can see, the variable ctr should be nothing if the audio file has the field ARTIST. BUT it changes in every iteration.

st

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [August 26, 2007, 7:16am UTC](https://community.mp3tag.de/t/x-put-or-puts-in-if-bug/5352/2 "2007-08-26T07:16:00Z")

</div>

No, you must place $put before the $if like here:  
[/t/3144/1](https://community.mp3tag.de/t/3144/1)

---

<div class="post-metadata">

### Author: ![Stevest](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/a698b9/32.png) [@Stevest](https://community.mp3tag.de/u/Stevest)
#### Post date: [August 26, 2007, 7:35pm UTC](https://community.mp3tag.de/t/x-put-or-puts-in-if-bug/5352/3 "2007-08-26T19:35:14Z")

</div>

Thank you very much. 🙂

st

---

<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:20pm UTC](https://community.mp3tag.de/t/x-put-or-puts-in-if-bug/5352/4 "2018-12-28T14:20:28Z")

</div>

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