Subj : Re: setting global scope To : Abhijat Thakur From : Igor Bukanov Date : Mon Jun 07 2004 01:30 pm Abhijat Thakur wrote: > > Hi, > > I am using Rhino and when i execute scripts i want to set glocal variables for the script. How can i do this ? I did go over the documentation of Rhino and read about Context and Scope but i could not get a hang of how it actually works. http://www.mozilla.org/rhino/tutorial.html#Expose , .... Add Java Object: The next example is RunScript2. This is the same as RunScript, but with the addition of two extra lines of code: Scriptable jsArgs = Context.toObject(System.out, scope); scope.put("out", scope, jsArgs); These lines add a global variable out that is a JavaScript reflection of the System.out variable: .... Regards, Igor .