Unable to find SystemConsole class

Oct 4, 2012 at 12:19 AM
Edited Oct 4, 2012 at 12:20 AM

So, I went to downloads page got the latest thing (updated in May), referenced the DLL, and got JS code working fine.

Till this code that requires the console, I tried the code in the homepage and documentation here:

context.SetParameter("console", new SystemConsole());

But it doesn't work. I can't find the SystemConsole class at all.

It feels that I'm missing something very obvious, what could it be?

Oct 4, 2012 at 3:00 PM

You need to create that class yourself; it's in the documentation right above that line of code.

public class SystemConsole
{
     public SystemConsole() { }

     public void Print(string iString) {
          Console.WriteLine(iString);
     }
}
Oct 7, 2012 at 8:13 AM

Thanks a lot. Yeah, not sure have I overlooked this is the same thing (I originally looked at the home page and the line following:

Set variables in the Javascript context's global scope: SetParameter(string iName, Object iObject);

But anyway, sounds fine. I just thought the console API is standard or something, at least stuff like console.log, but that's all good.