# Creation/Definition of global variable for each step of a loop

**URL:** <https://discourse.julialang.org/t/creation-definition-of-global-variable-for-each-step-of-a-loop/55881>\
**Category:** General Usage\
**Tags:** loops\
**Created:** [February 23, 2021, 8:09pm UTC](https://discourse.julialang.org/t/creation-definition-of-global-variable-for-each-step-of-a-loop/55881 "2021-02-23T20:09:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [February 23, 2021, 8:13pm UTC](https://discourse.julialang.org/t/creation-definition-of-global-variable-for-each-step-of-a-loop/55881/2 "2021-02-23T20:13:39Z")

</div>

This question comes up quite regularly, and the answer is usually “you shouldn’t”, see eg here [Creating multiple variables with consecutive names using a for loop](https://discourse.julialang.org/t/creating-multiple-variables-with-consecutive-names-using-a-for-loop/34177)

If you give me background as to what you avidly want to achieve people can probably suggest a different approach.

---

_[View the full topic](https://discourse.julialang.org/t/creation-definition-of-global-variable-for-each-step-of-a-loop/55881)._
