# Unexpected behavior of nested for loops when loading a macro with .L

**URL:** <https://root-forum.cern.ch/t/unexpected-behavior-of-nested-for-loops-when-loading-a-macro-with-l/64919>\
**Category:** Newbie\
**Created:** [June 27, 2026, 1:11am UTC](https://root-forum.cern.ch/t/unexpected-behavior-of-nested-for-loops-when-loading-a-macro-with-l/64919 "2026-06-27T01:11:05Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [June 27, 2026, 6:30am UTC](https://root-forum.cern.ch/t/unexpected-behavior-of-nested-for-loops-when-loading-a-macro-with-l/64919/3 "2026-06-27T06:30:54Z")

</div>

You try to use a so-called ROOT’s **unnamed macro**. Your source code must be enclosed in curly braces (I somehow remember that the “`{`” needed to be the very first line in a ROOT’s **unnamed macro** file):

```cpp
{
 // ... your source code ...
}

```

BTW. To load and execute a macro, you should use “`.x`”, not “`.L`”.

---

_[View the full topic](https://root-forum.cern.ch/t/unexpected-behavior-of-nested-for-loops-when-loading-a-macro-with-l/64919)._
