# counting variable

**URL:** https://community.mp3tag.de/t/counting-variable/7951
**Category:** Export
**Created:** [February 17, 2009, 12:26pm UTC](https://community.mp3tag.de/t/counting-variable/7951 "2009-02-17T12:26:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![goyschak](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@goyschak](https://community.mp3tag.de/u/goyschak)
#### Post date: [February 17, 2009, 12:26pm UTC](https://community.mp3tag.de/t/counting-variable/7951/1 "2009-02-17T12:26:13Z")

</div>

First of all, thank you very much for this great program and this dicussion board.  
I really do appreciate the amount of work put in here.

I started to code mtes and my own html page two weeks ago. I started with no knowledge about mte or html and have come a long way since. 😉

But now I'm stuck.  
I would like to generate a html via a mte so that all the album covers are shown in a table, which is 5 columns wide. Therefore I put a counter ("zaehler") into the script, to break the table line () as soon as it reaches 5 [line A]. That is working so far. But after that, the counter should be set to 0 [line B], so it can start counting again beginning in the next loop. But as soon as i include line B into the code, the counter ("zaehler") never advances above 1. It just stays there.

Could anybody give me some advice, please?

> [@](#):
>
> ...  
> $loop(%\_folderpath%)
> 
> ...(html code) $puts(zaehler,$add($get(zaehler),1)) **$if($eql($get(zaehler),5),,) [line A)] $if($eql($get(zaehler),5),$puts(zaehler,0),) [line B]** $loop(%\_filename\_ext%)$loopend()$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: [February 17, 2009, 1:14pm UTC](https://community.mp3tag.de/t/counting-variable/7951/2 "2009-02-17T13:14:56Z")

</div>

> [@goyschak](#):
>
> First of all, thank you very much for this great program and this dicussion board.  
> I really do appreciate the amount of work put in here.
> 
> I started to code mtes and my own html page two weeks ago. I started with no knowledge about mte or html and have come a long way since. 😉
> 
> But now I'm stuck.  
> I would like to generate a html via a mte so that all the album covers are shown in a table, which is 5 columns wide. Therefore I put a counter ("zaehler") into the script, to break the table line () as soon as it reaches 5 [line A]. That is working so far. But after that, the counter should be set to 0 [line B], so it can start counting again beginning in the next loop. But as soon as i include line B into the code, the counter ("zaehler") never advances above 1. It just stays there.
> 
> Could anybody give me some advice, please?

Two things:  
1.  
Maybe a closing round bracket is too much.  
$if($eql($get(zaehler),5),,) [line A)]

1. 

$put() and $puts() cannot be used as an argument within Mp3tag functions.  
You have to recode the line, e. g.  
$puts(zaehler,$if($eql($get(zaehler),5),0,$get(zaehler))

DD.20090217.1512.CET

---

<div class="post-metadata">

### Author: ![goyschak](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/g/8e8cbc/32.png) [@goyschak](https://community.mp3tag.de/u/goyschak)
#### Post date: [February 17, 2009, 1:38pm UTC](https://community.mp3tag.de/t/counting-variable/7951/3 "2009-02-17T13:38:23Z")

</div>

> [@DetlevD](#):
>
> Two things:  
> 1.  
> Maybe a closing round bracket is too much.  
> $if($eql($get(zaehler),5),,) [line A)]

The part between the isn't in the code. The ")" was a mistype. 😉

> [@DetlevD](#):
>
> 1. 
> 
> $put() and $puts() cannot be used as an argument within Mp3tag functions.  
> You have to recode the line, e. g.  
> $puts(zaehler,$if($eql($get(zaehler),5),0,$get(zaehler))

$puts(zaehler,$if($eql($get(zaehler),5),0,$get(zaehler))) 😉  
Thank you very much! That did the job!
