# Feature Suggestion: Variable Scope in Exports

**URL:** https://community.mp3tag.de/t/feature-suggestion-variable-scope-in-exports/7499
**Category:** General Discussion
**Created:** [November 20, 2008, 6:53pm UTC](https://community.mp3tag.de/t/feature-suggestion-variable-scope-in-exports/7499 "2008-11-20T18:53:23Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![Moonbase](https://community.mp3tag.de/user_avatar/community.mp3tag.de/moonbase/32/207_2.png) [@Moonbase](https://community.mp3tag.de/u/Moonbase)
#### Post date: [November 20, 2008, 6:53pm UTC](https://community.mp3tag.de/t/feature-suggestion-variable-scope-in-exports/7499/1 "2008-11-20T18:53:23Z")

</div>

Sometimes the scope of user variables in Exports is a little awkward to use, because it is _not_ possible to use a variable that has been set previously within an _outer_ loop. For some reason, the scope of the user variables extends _outwards_, not _inwards_.

This will _not_ function (and it’d be nice if it did!):

```
$loop(%genre%)
$puts(fn,%genre%.m3u)
$loop(%_path%)
ECHO %_path% >> $get(fn)
$loopend()
$loopend()

```

_(Over-simplified code snippet, extra line feeds added for readability.)_

The variable _fn_ will be undefined within the inner _$loop(…)_.

Is it possible to change that?

---

_[View the full topic](https://community.mp3tag.de/t/feature-suggestion-variable-scope-in-exports/7499)._
