[.net] Error on executing Console.WriteLine in JScript.NET
Ahoi,
i am actually experimenting with VsaEngine and JScript.NET. The system works good so far, but there is one problem: When i try to execute my JScript with a Console.WriteLine in it, i get the following error (i try to translate it ;)):
"The variable 'Console' has not been defined".
I do import "System" and have access to it.
Can anybody help me? I'd really appreciate it!
Thanks in advance
Metzler
Just a Quick Idea try putting System in front of the Console command to see if that works, This will make sure that you have added the referances to the system namespace correctly.
I believe you also have to add a reference to it when initializing the Vsa engine. I can't remember how again, but there were a series of articles on Microsoft's site about it.
I have tried, to put the System in front of it.
The error is now, that he asks, if the assembly-reference is missing. It's not ;) :
This is, what it looks like. I do set the reference to system.dll in my code....
The error is now, that he asks, if the assembly-reference is missing. It's not ;) :
import Scriptinterface;import System;class myClass implements IScript{ private var Host : IHost; function OutputMsg (text : String) { //System.Console.WriteLine("Hallo IM Script!"); var a : int = int(System.Math.PI); Host.OutputMsg("Hallo vom Script!"); } function GetHost (host : IHost) { Host = host; }}
This is, what it looks like. I do set the reference to system.dll in my code....
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement