# Global name in a variable - How to set it??

**URL:** <https://forum.servoy.com/t/global-name-in-a-variable-how-to-set-it/13809>\
**Category:** Classic Servoy\
**Created:** [April 1, 2011, 5:32pm UTC](https://forum.servoy.com/t/global-name-in-a-variable-how-to-set-it/13809 "2011-04-01T17:32:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kahuna](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@Kahuna](https://forum.servoy.com/u/Kahuna)\
**Post date:** [April 1, 2011, 5:32pm UTC](https://forum.servoy.com/t/global-name-in-a-variable-how-to-set-it/13809/1 "2011-04-01T17:32:12Z")

</div>

Hi Fols

I have a variable that holds an actual globals variable name:

myVar = ‘globals.mysetting’

I need to use this variable (myVar) to actuially set the global to a value so something like myVar = 1

Cant figure out the syntax to use for this if its possible??

Feedback appreciated.

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [April 1, 2011, 6:05pm UTC](https://forum.servoy.com/t/global-name-in-a-variable-how-to-set-it/13809/2 "2011-04-01T18:05:13Z")

</div>

globals[myVar]? You should chop off the ‘globals.’ part from ‘‘globals.mysetting’’ or store it initially without the ‘globals.’ prefix

Paul

---

<div class="post-metadata">

**Author:** ![Kahuna](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@Kahuna](https://forum.servoy.com/u/Kahuna)\
**Post date:** [April 2, 2011, 8:37am UTC](https://forum.servoy.com/t/global-name-in-a-variable-how-to-set-it/13809/3 "2011-04-02T08:37:35Z")

</div>

> pbakker:  
> globals[myVar]? You should chop off the ‘globals.’ part from ‘‘globals.mysetting’’ or store it initially without the ‘globals.’ prefix
> 
> Paul

Excellent - thanks Paul
