On Thu, 2005-08-25 at 07:41 -0600, Jason Johnston wrote:
> Thorsten Scherler wrote:
> > On Wed, 2005-08-24 at 16:45 -0500, Antonio Gallardo wrote:
> >>AFAIK, Thorsten already tried eval() and does not work. :-(
> >>
> >
> > Yeah, Antonio is right.
> >
> > The eval() gives "Calling eval() with anything other than a primitive
> > string value will simply return the value. Is this what you intended?".
> >
> > ...and that is not what I was intended. ;-)
>
> Hmm, you're right, I just tried it myself and got the same thing.
> eval() must be broken in Rhino.
>
> Another possibility: use the "new Function(string)" constructor to
> create a function from a string and then call it, for example:
>
> var evalFunc = new Function("string of JS code to evaluate here");
> evalFunc();
>
> If you want to pass particular arguments to it you can do that too; more
> details at
> http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Function#Created_By
Wow, sweet. Thx a million. I will try that and report back. :)
Muchas gracias
salu2
--
thorsten
"Together we stand, divided we fall!"
Hey you (Pink Floyd)