Among other programming languages CS-Script supports J#/JScript.
There is some ambiguity about the name of the language. MS usually refers Java based syntax for CLR as J#. However MS compiler for this syntax is implemented in Microsoft.JScript.dll. For the purpose of this article the terms JScript and J# are interchangeable.
The J# script compiler is implemented as a pluggable custom compiler (see
Alternative compilers). JScript script compiler assembly is deployed and enabled at the time of the CS-Script installation/upgrade.
The script code below is an example of the complete J# script
Hello.js from the
Implementing non-C# compilers tutorial.
//css_reference "System.dll"; //css_reference "System.Windows.Forms.dll"; import System;
import System.Windows.Forms;
public class Class1 {
public static function Main() {
Console.WriteLine("Hello World! (JScript)");
MessageBox.Show("Hello World! (JScript)")
}
} |
Note:
System.dll and
System.Windows.Forms.dll are referenced with
//css_reference statement directly from the code. Because automatic assembly loading is not available for non-C# scripts (see
Alternative Compilers for limitation details).
See Also
Alternative compilers |
Implementing non-C# compilers