# R93 update

**URL:** <https://www.ruby-forum.com/t/r93-update/134286>\
**Category:** IronRuby\
**Created:** [April 9, 2008, 2:58pm UTC](https://www.ruby-forum.com/t/r93-update/134286 "2008-04-09T14:58:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![akinsgre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ce73a5/32.png) [@akinsgre](https://www.ruby-forum.com/u/akinsgre)\
**Post date:** [April 9, 2008, 2:58pm UTC](https://www.ruby-forum.com/t/r93-update/134286/1 "2008-04-09T14:58:07Z")

</div>

I had written a small “hello world” app that read a ruby file, using  
IronRuby.

It used this “puts "Ruby and ${variable} together at last"” where  
“variable” is a global assigned in the C# program.

The program I’d written stopped compiling after the update so I looked  
on the Wiki for changes.

The Wiki shows this example  
[http://ironruby.rubyforge.org/wiki/wiki.pl?ExecutingIronRubyFromCSharp](http://ironruby.rubyforge.org/wiki/wiki.pl?ExecutingIronRubyFromCSharp)

> From that example, this line

```
ctx.GlobalVariables[SymbolTable.StringToId("variable")] = ".NET";

```

doesn’t work because the index on GlobalVariables has changed to a  
KeyValuePair

A, I’m confused about how to create a GlobalVariable object to put in  
that collection. B, I’m unsure if I’m headed down the right path,  
given the changes to the API. Is there a “New” way to assigned global  
variables?

Any help is greatly appreciated.

–  
Greg A.  
Software Development Manager  
SSI Services

[http://kc.vanadium.com](http://kc.vanadium.com)  
[http://www.pghcodingdojo.org](http://www.pghcodingdojo.org)  
[http://www.insomnia-consulting.org/monologue](http://www.insomnia-consulting.org/monologue)

---

<div class="post-metadata">

**Author:** ![akinsgre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ce73a5/32.png) [@akinsgre](https://www.ruby-forum.com/u/akinsgre)\
**Post date:** [April 9, 2008, 5:55pm UTC](https://www.ruby-forum.com/t/r93-update/134286/2 "2008-04-09T17:55:39Z")

</div>

I have had following working ok with the recent IR iterations:

```
    public object GetGlobalVar(string varName)
    {
        return ExecutionContext.GetGlobalVariable(varName);
    }

    public void SetGlobalVar(string varName, object value)
    {
        ExecutionContext.DefineGlobalVariable(varName, value);
    }

```

It indeed changed few iterations ago and broke my earlier code as well.

Robert B.  
Software architect  
Napa Ltd  
Tammasaarenkatu 3, Helsinki FI-00180  
P.O.Box 470, Helsinki FI-00181

Tel. +358 9 22 813 1  
Direct. +358 9 22 813 611  
GSM +358 45 11 456 02  
Fax. +358 9 22 813 800

Email: removed\_email\_address@domain.invalid

> **[Home – NAPA](https://www.napa.fi/)**
>
> NAPA provides intelligent solutions for maritime industry: Software, Services and Data Analysis for Ship Design and Operation. We combine naval architecture, shipping and digital expertise to help maritime business make the decisions that matter.

---

<div class="post-metadata">

**Author:** ![akinsgre](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ce73a5/32.png) [@akinsgre](https://www.ruby-forum.com/u/akinsgre)\
**Post date:** [April 9, 2008, 8:23pm UTC](https://www.ruby-forum.com/t/r93-update/134286/3 "2008-04-09T20:23:03Z")

</div>

On Wed, Apr 9, 2008 at 11:54 AM, Robert B.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> }
> 
> ```
> 
> It indeed changed few iterations ago and broke my earlier code as well.

Thanks. That also helped me find some relevant tests that gave me a  
little more information about what’s happening there.

I appreciate your help.

–  
Greg A.  
Software Development Manager  
SSI Services

[http://kc.vanadium.com](http://kc.vanadium.com)  
[http://www.pghcodingdojo.org](http://www.pghcodingdojo.org)  
[http://www.insomnia-consulting.org/monologue](http://www.insomnia-consulting.org/monologue)
