# Determine the last loop inside loop?

**URL:** https://community.mp3tag.de/t/determine-the-last-loop-inside-loop/7231
**Category:** Export
**Created:** [September 23, 2008, 7:26am UTC](https://community.mp3tag.de/t/determine-the-last-loop-inside-loop/7231 "2008-09-23T07:26:10Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![LosMintos](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/54ee81/32.png) [@LosMintos](https://community.mp3tag.de/u/LosMintos)
#### Post date: [September 23, 2008, 7:26am UTC](https://community.mp3tag.de/t/determine-the-last-loop-inside-loop/7231/1 "2008-09-23T07:26:10Z")

</div>

Hi,

unfortunatly I do not know proper keywords for a search and maybe I'm somehow blind ☹

Consider a loop over an album in order to export the tracklisting, something like $loop(%\_filename\_ext%)

```
  $num(%track%,2) -- %title%
$loopend

```

I'm trying to execute a command only in the last loop, e.g.

```
$loop(%_filename_ext%) 
  $num(%track%,2) -- %title%
  IF this is the very last run of this loop, than do ... else nothing.
$loopend

```

I tried %\_max\_counter%, %\_total\_files% and defined a variable (puts(condition, %\_total\_files%) ... But it does not work ☹ In my case it is not a solution, to put my commands after the loop.

(By the way, it was easy to determine the first loop: $if($eql(%\_counter%,1),true,false).

Any help is appreciated. Regards, LosMintos

---

_[View the full topic](https://community.mp3tag.de/t/determine-the-last-loop-inside-loop/7231)._
