 |
|
 |
Hi,
Nice work.
I have convert the projct to VS 2005 and compiled it. (Same problem in VS 2008)
I have used this script - test.ncs:
using System.Windows.Forms;
class Test
{
static void Main(string[] args)
{
MessageBox.Show("Hello World!", "NScript");
}
};
When running nscriptw test.ncs i get this message:
The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)
When using this nvb script:
Imports System.Windows.Forms
Module AnyThingYouLike
Sub Main(ByVal Args() As String)
MessageBox.Show("Hello World!", "nscript", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
End Module
Message:
Namespace or type specified in the Imports 'System.Windows.Forms' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
But the old binary files from the setup works.
What is the problem?
Did i forget anything?
Thanks!
|
|
|
|
 |
|
 |
Hi!
Can you believe that I Was just about to call my nearly-Finished Scripting language NScript? And even that I Was also going to use the .ncs Extension?
It was just out of curiosity that i searched NScript on google and found this page!
Well I guess you beat me to it anyway. Well... Great minds think alike!
I was, however, going to name my scripting language NScript for 'NightSoft' Script, NightSoft Being my Software and web design buisness.
Well, I'm Sure I'll think of another name!
Thanks!
MrWolfy
|
|
|
|
 |
|
 |
Hello,
I have re-packaged and re-compiled Rama's project for the Microsoft .NET Framework 2.0 and I am calling it Windows Script Host .NET (WSH.NET). It is available as an open-source project at Google Code from the following link:
http://code.google.com/p/windowsscripthostdotnet
This version of the script engine support C#, JScript.NET, VB.NET, and J#. It requires the .NET Framework 2.0 as well as the J# 2.0 extension. Please it check out! I would like to hear your feedback and suggestions.
Thank you,
Bleekay.
|
|
|
|
 |
|
 |
I have an issue in which I have to get object as return value from the ncs file that had been executed.
Awaiting for ray of light.
Sikunj
|
|
|
|
 |
|
 |
Try using System.Environment.ExitCode = int for console apps and System.Windows.Forms.Application.Exit(int) for WinForm apps. Here's a (useless) example that illustrates the point:
===CheckTime.bat===
@Echo Off
@Echo [Demo1]
@Echo
nscriptc checktime.cs
goto Greeting%errorlevel%
:Greeting0
echo Good Morning
goto end
:Greeting1
echo Good Afternoon
goto end
:Greeting2
echo Good Evening
goto end
:end
====CheckTime.ncs===
using System;
namespace CheckTime
{
class Class1
{
static void anotherMethod()
{
int greetingId;
int hourNow = System.DateTime.Now.Hour;
if (hourNow < 12)
greetingId = 0;
else if (hourNow < 18)
greetingId = 1;
else
greetingId = 2;
System.Environment.ExitCode = greetingId;
//System.Environment.ExitCode = int for console apps
//System.Windows.Forms.Application.Exit(int) for WinForm apps
}
static void Main(string[] args) //must have args
{
anotherMethod();
}
}
}
|
|
|
|
 |
|
 |
Sorry!
Change "nscriptc" to "nscript" in the above post.
|
|
|
|
 |
|
 |
Just to put my money where my mouth is I have uploaded a new copy of the source code to the following URL:
http://files-upload.com/files/541201/NScript.zip
Sorry about the ads and count down timer but they offer free on-line file storage.
This has been updated to VS.2003 (.NET Framework 1.1) and to include J# support. I added the file extensions .jsl / .njl to run as J# script files.
...no XML support, yet.
|
|
|
|
 |
|
 |
Sorry, the file association thing didn't work so well. Just use the "Open With..." option and associate it with NScriptW and it should run.
====HelloWorld.jsl====
package Test;
import System.Windows.Forms.*;
public class Test extends System.Windows.Forms.Form
{
public static void main(String[] args)
{
MessageBox.Show("Hello World!","J# Sample Script");
}
}
|
|
|
|
 |
|
 |
I have a code written in C/C++ for Mac , I need to convert the same for Windows.
In the code they have used C/C++ Script file and I am wishing to use the same.
Can we do the same or am I on wrong tracks ?
Sikunj
|
|
|
|
 |
|
 |
If you can convert your C/C++ script into C# this would work like a charm!
|
|
|
|
 |
|
 |
First, I must say, "This is so cool!!" I wish I had found this a couple of years ago.
Now my questions:
1) How would you add support for using J# (J-Sharp)? ...and VC++.NET while I'm asking.
2) Has anyone worked on support for scripts in an XML file format like .WSF files (say, we call them .NSF files)
3) How would you add version control to specify which version of the .NET Framework to use if you have access to more than one version (e.g. 1.0a, 1.1, 2.0, 3.0)
I'm a newbie trying to dive deeper into programming and I'd like to figure our how to add these features.
bleekay
|
|
|
|
 |
|
 |
Also, does NScript support referencing/importing other scripts?
TIA...
|
|
|
|
 |
|
 |
Okay,
I realize that I may appear like a bit of a twit ... Alright, I am a twit but I digress ... Thanks to Google I found another project under TheCodeProject called Dot Net Script By jconwell. This effectively accomplishes what I was dreaming about the other day by having scripts in an XML format (like .WSF files) and adding additional languages such as J# and JScript. To be the perfect form of WSH.NET I am envisioning NScript and Dot Net Script combined into one project.
I am will attempt to wrap my brain around both of these and try to combine them (with help from the original authors, of course).
bleekay
|
|
|
|
 |
|
 |
Alright,
I have figured out how to add J-sharp support under Visual Studio 2003 ... not that hard when I finally sat down to do it.
Now, for XML support.
|
|
|
|
 |
|
 |
Has anyone managed to use intellisense with this? I have associated nvb files with VS by editing HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Languages\File Extensions\ so I am getting syntax highlighting, but Intellisense would be the mutts knees.
|
|
|
|
 |
|
 |
I actually used nscript and then shifted to cs-script because the scripts are simply the main file for a normal console program. I have a template for a small console program but I substitute the script to get intellisense during development. You can edit the csproj file (manually) to reference your script directory. Then whenever you modify the script you're simply editing a normal console app but after you're done you can tweak without recompiling.
|
|
|
|
 |
|
 |
I added code to print Exception.Source and Exception.StackTrace based on the availabe source code. Trying to help locate script problem.
if this change helps, it is available at
http://www.yeeting.com/nscript
|
|
|
|
 |
|
 |
First of all, NScript works great !
I am now attempting to catch any run-time exception and to launch the current JIT debugger.
Is it possible ?
Basically, suppose I write a .CS script containing a division by zero sequence: I would like that the Visual Studio 2005 IDE popup, load the .CS file and highlight the faulty line.
Any tip is appreciated.
Regards,
Ciro
|
|
|
|
 |
|
 |
Hi, how can run js file in c#.net by jscript ?
is there any way that i set javascript code in a string and then run it az jscript?
|
|
|
|
 |
|
 |
Sorry, I'm a JScript newbie... can someone help me figure out how to write the entry point in Javascript?
|
|
|
|
 |
|
 |
You don't. Cool!
|
|
|
|
 |
|
 |
Rama et al, Could you supply me with the same Hello World script but written in VB.NET and saved as a .nvb file. My failed attempt is: **** Start of Test.nvb **** Imports System.Windows.Forms; Class Test Sub Main(ByVal Args as String) MessageBox.Show "Hello World!", "NScript" End Sub End Class **** End of Test.nvb **** Hope somebody could help. Regards, Neil Regards, Neil
|
|
|
|
 |
|
 |
This should do it:
Imports System.Windows.Forms
Module AnyThingYouLike
Sub Main(ByVal Args() as String)
MessageBox.Show("Hello World!", "nscript", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
End Module
Cheers, Dave
-- modified at 10:55 Tuesday 22nd November, 2005
|
|
|
|
 |
|
 |
I am trying to get a script to use System.Data.SqlClient.SqlConnection and it seems to compile fine but when it runs I get "Exception has been thrown by the target of an invocation" as soon as it tries to access any property like oConn.ConnectionString. I can "new" up an instance of the class but when it comes time to use it...error.
Correct me if I'm wrong but isn't this message usually due to a missing assembly?
I can run the code fine in .EXE and have compared the .EXE references with nscript.nrf and everything is there. I saw Richard_D posted a question about whether nscript.nrf was working, but then it seems to have been resolved. Not sure if it is related.
Any ideas?
|
|
|
|
 |
|
 |
Hey, nice little util u have here,
i just wonder... im building an application where i want it to be possible to manipulate data with user scripts
executed from the main application.
This brings me to the question, how do i return values from the scripts i run using nscript?
example
i = 4;
[search for user script for manipulating data]
[found script taking an int and returning int^2]
i = nscript(userfunction.nsc)
quadcamper@hotmail.com
/Johan
|
|
|
|
 |