Results 1 to 4 of 4

Thread: Anyone using JScript.Net?

  1. #1
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default Anyone using JScript.Net?

    Anyone using JScript.Net?

    It uses the .Net Framework and the syntax is similar to JScript. I wonder if it is a popular as C# or VB.Net because I do not see it on the index of www.tiobe.com

    Here's what the code looks like.
    Code:
    // Wrap the function inside a class statement.
    class Car
    {
       // Declare the class members. I've used types in this example,
       // but they are not required. I could have also marked the class
       // as being 'expando' and not had to declare these members.
       var make : String;
       var color : String;
       var year : int;
    
       // Old constructor function, unchanged.
       function Car(make, color, year)
       {
          this.make = make;
          this.color = color;
          this.year = year;
       }
    
       // Move the function inside the class
       function GetDescription()
       {
          return this.year + " " + this.color + " " + this.make;
       }
    }
    Syntax-wise, it is similar but it does not mean that a browser that supports JScript will support JScript.Net


    JScript .NET incorporates almost all of the features of the ECMAScript Edition 3 Language Specification. In addition, JScript .NET is being developed in conjunction with ECMAScript Edition 4 and incorporates many of the proposed features of that language as well.
    What Is JScript .NET?

    JScript .NET is the next generation of an implementation by Microsoft of the ECMA 262 language. Combining the feature set of previous versions of JScript with the best features of class-based languages, JScript .NET includes the best of both worlds. Improvements in JScript .NET — which is being developed in conjunction with ECMAScript Edition 4 — include true compiled code, typed and typeless variables, late- and early-binding, classes (with inheritance, function overloading, property accessors, and more), packages, cross-language support, and full access to the .NET Framework.

    Programs written in JScript .NET can be used in many contexts. The script engine in a Web browser runs a script that is embedded in a Web page. Windows Script Host runs a script that is embedded in an ASP or ASP.NET page. JScript .NET programs can also be compiled (using jsc.exe, the new JScript command-line compiler) to create executable programs.

    JScript .NET is a true object-oriented scripting language. Although JScript .NET can now use classes, types, and other advanced language features for writing robust applications, it retains its "scripting" feel, with support for typeless programming, expando functions and classes, dynamic code execution (using eval), and more.

    In addition to being a typeless language, JScript .NET can now be a strongly typed language. In previous versions, the loosely typed structure of JScript meant that variables assumed the type of the value assigned to them. In fact, you could not declare the data types of variables in previous versions. JScript .NET provides more flexibility than previous versions of JScript by allowing variables to be type annotated. This binds a variable to a particular data type, and the variable can store only data of that type.

    There are many advantages of strong typing in a programming language. In addition to the benefit that occurs when you use a data type that properly fits the data you are using, you get several other benefits:
    • Improved execution speed
    • Run-time/compile-time type-checking
    • Self-documenting code

    Finally, it is important to remember that JScript .NET is not a condensed version of another programming language, nor is it a simplification of anything. It is a modern scripting language with a wide variety of applications.
    Note The code in many of the included JScript .NET examples is somewhat more explicit and less dense than in actual scripts. The intent is to clarify the concepts rather than to express optimal coding conciseness and style. In any case, there is no shame in writing code that you can read and easily understand six months after you write it.
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  2. #2
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    I downloaded the J# run time and tried it. At first glance I thought too much wrappers but then the intellisense work and I got java classes from the addition of the vjslib.dll to a C# project

    vjslib.dll
    Code:
    using java.applet;
    using java.awt;
    using java.awt.datatransfer;
    using java.awt.@event;
    using java.awt.image;
    using java.awt.peer;
    using java.beans;
    using java.io;
    using java.lang;
    using java.math;
    using java.net;
    using java.security;
    using java.sql;
    using java.text;
    using java.util;
    using java.util.zip;
    Well that is about it. Java# is not my cup of tea. I already have C#, C++, and javascript, so it just a bit more libraries that I get if I ever need them.

    http://msdn.microsoft.com/msdnmag/is...12/NETMatters/
    The J# run-time library, vjslib.dll, is available as a redistributable component, just like the .NET Framework. You can download it from Visual J# Downloads (it's also installed as a prerequisite by Visual Studio®). In the same manner that a C# or C++ application can make use of Microsoft.VisualBasic.dll (the Visual Basic run-time library), C#, Visual Basic®, and C++ applications can use the J# run-time library and the numerous interesting classes it exposes.

    Some folks use the J# Zip libraries to meet their compression requirements (see Zip Your Data: Using the Zip Classes in the J# Class Libraries to Compress Files and Data with C#), but beyond that there are some very interesting gems hidden in the library. For your needs, I suggest you see the java.math.BigInteger class (a BigDecimal class is also available). Here's an example of using BigInteger, showing that it can be used with values larger than the largest UInt64
    Samples here

    For anyone trying to use J#, check here.
    http://msdn.microsoft.com/vjsharp/downloads/
    I saw something about swing which comes with J# version 2, and an update of J# for VS2002
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  3. #3
    Join Date
    Dec 2005
    Posts
    41
    Rep Power
    0

    Default

    Well, you got me going for sure!

    i mean, you talking about JScript.Net or J# here?

  4. #4
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Oh didnt reallize there was a difference
    Last edited by crosswire; Jan 15, 2006 at 02:44 PM.
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •