# Placeholder that can count inside "if" function

**URL:** https://community.mp3tag.de/t/placeholder-that-can-count-inside-if-function/3144
**Category:** General Discussion
**Created:** [April 5, 2006, 12:00pm UTC](https://community.mp3tag.de/t/placeholder-that-can-count-inside-if-function/3144 "2006-04-05T12:00:26Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![milka](https://community.mp3tag.de/user_avatar/community.mp3tag.de/milka/32/55_2.png) [@milka](https://community.mp3tag.de/u/milka)
#### Post date: [April 5, 2006, 12:00pm UTC](https://community.mp3tag.de/t/placeholder-that-can-count-inside-if-function/3144/1 "2006-04-05T12:00:26Z")

</div>

I can't get counter value inside of "if" function.  
So I was wondering is it posible to write placeholder that can count (like %\_counter%) inside "if" function.

Example:  
$loop(%\_folderpath%)

$if($eql($folderdepth(%\_folderpath%),$folderdepth(%\_workingpath%)),,%\_counter\_if%)

$loopend

Please reply Florian, thanks  
~ milka

---

<div class="post-metadata">

### Author: ![Sebastian\_Mares](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sebastian_mares/32/9285_2.png) [@Sebastian\_Mares](https://community.mp3tag.de/u/Sebastian_Mares)
#### Post date: [April 5, 2006, 12:09pm UTC](https://community.mp3tag.de/t/placeholder-that-can-count-inside-if-function/3144/2 "2006-04-05T12:09:11Z")

</div>

What exactly are you trying to achieve?

---

<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: [April 5, 2006, 12:27pm UTC](https://community.mp3tag.de/t/placeholder-that-can-count-inside-if-function/3144/3 "2006-04-05T12:27:26Z")

</div>

Already possible:

```
$loop(%_folderpath%)$puts(cnt,$if($eql($folderdepth(%_folderpath%),$folderdepth(%_workingpath%)),$get(cnt),$add($get(cnt),1)))
$loopend()
$get(cnt)
```

---

<div class="post-metadata">

### Author: ![milka](https://community.mp3tag.de/user_avatar/community.mp3tag.de/milka/32/55_2.png) [@milka](https://community.mp3tag.de/u/milka)
#### Post date: [April 5, 2006, 1:34pm UTC](https://community.mp3tag.de/t/placeholder-that-can-count-inside-if-function/3144/4 "2006-04-05T13:34:18Z")

</div>

Thanks dano, but I dont think that thats it.  
I dont wont to get max counter, I just wont to count inside "if" function.

I will test it when I came home.

What is "$get( **cnt** )"?

~ milka

---

<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: [April 5, 2006, 2:20pm UTC](https://community.mp3tag.de/t/placeholder-that-can-count-inside-if-function/3144/5 "2006-04-05T14:20:13Z")

</div>

cnt is a user defined variable that I declared with $puts (see scripting help file)

And please write w **a** nt.

---

<div class="post-metadata">

### Author: ![milka](https://community.mp3tag.de/user_avatar/community.mp3tag.de/milka/32/55_2.png) [@milka](https://community.mp3tag.de/u/milka)
#### Post date: [April 5, 2006, 2:26pm UTC](https://community.mp3tag.de/t/placeholder-that-can-count-inside-if-function/3144/6 "2006-04-05T14:26:41Z")

</div>

> [@](#):
>
> And please write want.

Sorry. ![:blush:](https://community.mp3tag.de/uploads/default/original/1X/c5a064300f7d900a70c2196f6eee95e32dde9b52.gif ":blush:") My english is bad.

You don't have to bother with this, because it's hard to do or even impossible.  
I was just trying to help to HankD.

~ milka

---

<div class="post-metadata">

### Author: ![milka](https://community.mp3tag.de/user_avatar/community.mp3tag.de/milka/32/55_2.png) [@milka](https://community.mp3tag.de/u/milka)
#### Post date: [April 6, 2006, 4:08am UTC](https://community.mp3tag.de/t/placeholder-that-can-count-inside-if-function/3144/7 "2006-04-06T04:08:45Z")

</div>

I make it, thanks again dano.  
I just nedded to put $get(cnt) inside of loop.

```
$loop(%_folderpath%)$puts(cnt,$if($eql($folderdepth(%_folderpath%),$folderdepth(%_workingpath%)),$get(cnt),$add($get(cnt),1)))
$get(cnt)
$loopend()

```

Best regards,  
~ milka
