URGENT: Run a script from in a script

Aug 5, 2010 at 3:42 AM

Hi,

I am trying to dynamically load scripts into another script and then call them. For example, in my main script I load a new string, scriptCodeString, which contains the source code for a javascript function called build(). I then call

engine.Run(scriptCodeString);

to load the script into the interpreter.

The next line of my javascript is then:

build();

It should work, but it throws an exception. I therefore tried to call

engine.Run("build();");

But it also throws an exception. I am therefore stumped.

Can somebody please tell me how to execute a script from within a script?

Thanks!

Coordinator
Aug 19, 2010 at 6:17 AM
Hi, Have you tried using the version on svn ? This functionality was needed on the htmlx project (htmlx.codeplex.com). You should be able to find what you need. Otherwise, I think the eval function could fit your need. Did you also try it ?