# Modifying Global String

**URL:** <https://www.ruby-forum.com/t/modifying-global-string/207868>\
**Category:** IronRuby\
**Created:** [June 4, 2011, 5:47pm UTC](https://www.ruby-forum.com/t/modifying-global-string/207868 "2011-06-04T17:47:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [June 4, 2011, 5:47pm UTC](https://www.ruby-forum.com/t/modifying-global-string/207868/1 "2011-06-04T17:47:06Z")

</div>

If i set a global in the engine and modify it like this in c#

scriptEngine.Runtime.Globals.SetVariable(“Name”, ‘none’);

And then in ruby do:

Name = ‘A new Name’

And then try to get the global back, it is ‘none’ and not ‘A new Name’.  
How can modify the global variable and get it back?

I tried using scope, but then i kept getting an exception about the  
global being undefined, so i too questions really, how do you get  
variables out of scopr in ruby script?
