Jump to content
  • Advertisement
Sign in to follow this  
Metzler

[.net] Error on executing Console.WriteLine in JScript.NET

This topic is 5465 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 ;) :


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....

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!