|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Introduction to JScript 8.0 for JScript Programmers
The information presented here is mainly for programmers who are already familiar with JScript and want to learn about the new features introduced in JScript 8.0.
- How to compile programs
The JScript 8.0 command-line compiler creates executables and assemblies from JScript programs. For more information, see.
- How to write a "Hello World" program
It is easy to write the JScript 8.0 version of "Hello World". For more information, see.
- How to use data types
In JScript 8.0, a colon specifies the type in a variable declaration or function definition. The default type is Object, which can hold any of the other types. For more information, seeand .
JScript 8.0 has several built-in data types (such as int, long, double, String, Object, and Number). For more information, see. You can also use any .NET Framework data type after importing the appropriate namespace. For more information, see .
- How to access a namespace
A namespace is accessed using either the import statement (when using the command-line compiler) or the @import directive (when using ASP.NET). For more information, see. The /autoref option (which is on by default) automatically attempts to reference the assemblies that correspond to namespaces used in a JScript .NET program. For more information, see .
- How to create typed (native) arrays
A typed array data type is declared by placing square brackets () after the data type name. You can still use JScript array objects, objects created with the Array constructor. For more information, see.
- How to create a class
In JScript 8.0, you can define your own classes. Classes can include methods, fields, properties, static initializers, and sub-classes. You can write a completely new class, or you can inherit from an existing class or interface. Modifiers control the visibility of the class members, how members are inherited, and the overall behavior of a class. Custom attributes can also be used. For more information, seeand .