# Warning: $if executes regardless of conditional!

**URL:** https://community.mp3tag.de/t/warning-if-executes-regardless-of-conditional/9013
**Category:** General Discussion
**Created:** [September 22, 2009, 10:14pm UTC](https://community.mp3tag.de/t/warning-if-executes-regardless-of-conditional/9013 "2009-09-22T22:14:08Z")
**Posts on this page:** 3
**Page:** 1

<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: [September 22, 2009, 10:14pm UTC](https://community.mp3tag.de/t/warning-if-executes-regardless-of-conditional/9013/1 "2009-09-22T22:14:08Z")

</div>

1 Select 3 tracks  
2 Export with config

```
$loop(%dummy%)counter=%_counter% $if($eql(%_counter%,1),putting $put(t,%_counter%),getting $get(t))
$loopend()

```

Expected:

> [@](#):
>
> counter=1 putting 1  
> counter=2 getting 1  
> counter=3 getting 1

Observed:

> [@](#):
>
> counter=1 putting 1  
> counter=2 getting 2  
> counter=3 getting 3

Workaround: $loop(%dummy%)counter=%\_counter% $if($eql(%\_counter%,1),putting $put(t,$if($eql(%\_counter%,1),%\_counter%,$get(t))),getting $get(t))  
$loopend()

---

<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: [September 22, 2009, 10:56pm UTC](https://community.mp3tag.de/t/warning-if-executes-regardless-of-conditional/9013/2 "2009-09-22T22:56:10Z")

</div>

$put() and $puts() cannot be used as an argument within Mp3tag functions.

See also:  
[counting variable](https://community.mp3tag.de/t/7951/2)  
[Tips on User Defined Variables](https://community.mp3tag.de/t/4738/2)  
[Feature Suggestion: Variable Scope in Exports](https://community.mp3tag.de/t/7499/1)  
[Benutzerdefinierte Variable nicht sichtbar in Loop](https://community.mp3tag.de/t/4489/1)  
[$puts failure?](https://community.mp3tag.de/t/6524/1)

DD.20090923.0256.CEST

---

<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: [September 23, 2009, 10:38am UTC](https://community.mp3tag.de/t/warning-if-executes-regardless-of-conditional/9013/3 "2009-09-23T10:38:18Z")

</div>

> $put() and $puts() cannot be used as an argument within Mp3tag functions.

That's not my experience, Detlev. The above is an example of where they can be used, provided one knows the unusual behaviour of $if(), and here is an example of more regular use:

$regexp(21h30,$put(r,'^([0-9]{2}).([0-9]{2})$'),\1) --- $regexp(21h30,$get®,\2)
