VB.NET - please explain

Asked By sai prasanth on 06-Apr-11 08:13 AM
HI,

WHAT IS THE DIFFERENCE BETWEEN VBSCRIPT AND JAVASCRIPT
Reena Jain replied to sai prasanth on 06-Apr-11 08:25 AM
hi,

Java Script and VB Script are both programming languages that programmers use as tools to develop applications for personal computers.

JavaScript is a client-side scripting language; it is interpreted (and statements executed) by a user's browser.
VBScript is a server-side scripting language; it is interpreted (and statements executed) by the server (specifically, IIS).

VBScript and IIS (Internet Information Server) are Microsoft products.
According to Wikipedia:
"JavaScript is an object-oriented scripting language used to enable programmatic access to objects within both the client application and other applications. ... JavaScript was influenced by many languages and was designed to look like Java, but to be easier for non-programmers to work with."

According to Wikipedia:
"VBScript (short for Visual Basic Scripting Edition) is an Active Scripting language, developed by Microsoft, which uses the Component Object Model to access elements of the environment within which it is running.... The language's syntax reflects its origins as a limited variation of Microsoft's Visual Basicprogramming language."

Hope this will help you

Nikhil Mahajan replied to sai prasanth on 06-Apr-11 08:29 AM
Javascript
==============
Javascript case sensitive.
Javascript will be run on client side.
javascript support all the browser

VBScript
==============
VBScript not case sensitive.
VBScript will be run on server side.
vbscript only support Inernet explorer broweser not other
dipa ahuja replied to sai prasanth on 06-Apr-11 08:31 AM
Both are scripting language

Main difference :

Javascript case sensitive. Javascript will be run on client side mainly for checking form validations

VBScript not case sensitive. VBScript will be run on server side for server side validations

VB Script does not support client side validation where as Jscript supports it.

For Eg: If we want to validate some date before sending to the server Vb script doesn't support it where as JavaScript suports it

VB Script is compatible with only IE. Java is compatible with all browsers
Jitendra Faye replied to sai prasanth on 06-Apr-11 08:50 AM
There are following differences between VBScript and Javascript-

1. vbscript only support Inernet explorer broweser not other.
but javascript support all the browser.

2. vbscript is case insenstive, javascript is case sensetive

3. vbscript is developed by Microsoft and javascript is developed by NetScape.

4.Vbscript is server side and Javascript is clien side.

I hope this will help you to get about both scripting languages,
Riley K replied to sai prasanth on 06-Apr-11 08:51 AM

 A clear description is given in MSDN

VBScript

VBScript is a subset of Visual Basic for Applications. Therefore, VBScript programming has many similarities to Visual Basic for Applications programming. Many of the powerful features of Visual Basic for Applications, such as classes and API calls, were omitted to make the language portable and secure.

Although VBScript is just text and can be written with a simple text editor, a graphical design tool for VBScript is available. This visual layout tool is called ActiveX Control Pad. ActiveX Control Pad allows you to combine HTML code, ActiveX controls, HTML layouts, and VBScript or JavaScript. ActiveX Control Pad works in conjunction with the HTML Layout control. The HTML Layout control is a drawing board that allows you to visually add and manipulate controls. ActiveX Control Pad will be discussed in detail later in this book.

VBScript promises the same boom in ActiveX development that we have seen in OCX controls development. Because VBScript, with the support of the Internet Explorer, can automate ActiveX components, vendors can design ActiveX controls to perform particular Internet tasks. A stock ticker control is a good example of such a control. Admittedly, we already have a rich assortment of ActiveX controls in the form of OCX controls, but these controls are typically not optimized for downloading across the Internet. For example, many of these controls contain sizable design-time components that cause long delays during a download.

VBScript does not have an integrated debugging environment (IDE). This means that code debugging can be rather demanding. Typically, you run the script in a browser and troubleshoot any errors that may occur. Perhaps the most useful debugging component is a well-placed MsgBox, and until a complete IDE is available, development will remain cumbersome. The obvious need for an IDE is overwhelming, and Microsoft certainly knows that programmers want one; however, releasing VBScript "as is" allows developers to get a handle on the new concepts without waiting for a more formal product. After coding a few pages directly, you will quickly master any IDE that is delivered in the future.

Compatibility with existing browsers is another issue for VBScript. Although the Internet Explorer supports both VBScript and JavaScript, VBScript is not currently supported by the Netscape browser. In the future, we may see support from Netscape and others, but for now, interactive web sites that use VBScript are limited to platforms running the Internet Explorer.

In a bid to create standard scripting support that would broaden the appeal of VBScript while maintaining current support for other engines, such as JavaScript, Microsoft is working with the World Wide Web Consortium to develop a standard for ActiveX Scripting and the event-driven model. Such efforts will improve the viability of VBScript, but even without an absolute standard, the Internet Explorer promises to have a large market share because of tight integration with future releases of Windows. Ultimately, VBScript may take center stage in Windows development as the browser becomes the primary desktop interface. Work is ongoing at Microsoft to completely unify the desktop environment inside the browser, creating a single, comprehensive view of local files, network files, and Internet files. This new view is known as page view.

Implementing page view will radically alter the Windows desktop environment. First and foremost, the concept of a separate browser running on a desktop is eliminated. In fact, the browser will be the desktop. Imagine an environment in which the Windows Explorer is replaced by a browser interface. You will view all of the files on your local machine just as if they are web pages. Need to see a Word document? View it in a browser. Need to work on a Microsoft Excel spreadsheet? Open it in the browser.

Ultimately, the user will work with all data the same way, regardless of the location of the data. For example, local, network, and Internet files will be seamlessly integrated into the browser interface. This represents a significant advance in the user interface because users will no longer have to worry about data location and the technical knowledge necessary to connect to the data.

JavaScript Versus VBScript

JavaScript and VBScript have many similarities. In fact, anyone who has mastered VBScript will find JavaScript just as easy to learn. Since the Internet Explorer supports both languages, knowledge of the fundamentals of both is valuable. The key differences between JavaScript and VBScript are covered in the paragraphs that follow.

Syntax

As stated before, the most obvious difference is syntax. JavaScript uses curly braces to denote functions, whereas VBScript uses Function…End Function and Sub…End Sub. In fact, JavaScript supports only functions, whereas VBScript supports functions and subroutines. If you want to create a function that behaves like a subroutine in JavaScript, simply omit the return value.

Objects

Neither JavaScript nor VBScript is truly object-oriented. Without digressing into a full definition of object-oriented programming, we can safely say that neither language exhibits all of the characteristics of a truly object-oriented language. Neither language, for example, supports the concept of inheritance.

JavaScript, however, makes stronger use of objects than does VBScript. JavaScript allows for the definition of classes for the subsequent creation of objects. To define a class, you create a function that specifies the class name and the class's properties and methods. For example, the following code defines a class called Student that has three properties:

function Student (name, height, weight) {
  this.name=name
  this.height=height
  this.weight=weight
} 

Values are assigned to properties using the this keyword, which always references the new object. This type of design allows JavaScript to encapsulate properties and methods inside an object. Creating an instance of the Student class is a simple matter of calling the function and using the new keyword:

mystudent=new Student("John",70,175) 

Unfortunately, VBScript does not support object creation or user-defined classes. VBScript supports only reusable functions and subroutines. In order to use VBScript to manage the above information for multiple students, we would have to create separate variables for each student we wanted to track. We could accomplish this by using arrays, for example.

Language Scalability

A primary difference between VBScript and JavaScript is scalability. Once you learn VBScript, you are well on your way to learning Visual Basic for Applications. If you know Visual Basic or Visual Basic for Applications, you know VBScript. Although JavaScript has similarities to C++, it is a new language.

Other Scripting Languages

Because Microsoft has designed ActiveX Scripting to be an open standard, JavaScript and VBScript may soon be joined by other scripting languages. The Internet Explorer can support any scripting language that takes advantage of ActiveX Scripting. Third-party vendors may choose to design their own scripting languages.

The VBScript Language

In order to understand the VBScript language, you must first understand what's missing. VBScript is not a complete, mature development language. Many features that are a necessity in advanced languages, such as data types, are not supported in VBScript. The language is a simple collection of fundamental features taken right out of the Visual Basic for Applications language. If you have programmed with Visual Basic for Applications before, you will find VBScript familiar. Table 2-1 shows the features of the VBScript language. Appendix C shows the Visual Basic for Applications features that are not supported by VBScript. For more information, consult the VBScript documentation on this book's companion CD and at Microsoft's web site.

Table 2-1.The VBScript Language

Category Keywords
Array handling Array function

Declaration (Dim, Static, etc.)

Lbound, Ubound

ReDim, Erase

Assignment =, Let, Set
Comments REM and '
Constants/Literals Empty, Nothing, Null

True, False

User-defined literals

Control flow Do…Loop

For…Next, For Each...Next

While…Wend

If…Then…Else

Select…Case

Conversion Abs

Asc, Chr

CBool, CByte

CDate, CDbl, CInt

CLng, CSng, CStr

CVErr

Fix, Int, Sgn

Hex, Oct

Date/Time Date function, Time function

Day, Month, Weekday, Year

Hour, Minute, Second

Now

DateSerial, DateValue

TimeSerial, TimeValue

Error handling On Error Resume Next

Err Object

Input/Output InputBox

MsgBox

Math Atn, Cos, Sin, Tan

Exp, Log, Sqr

Randomize, Rnd

Miscellaneous Line continuation character (_)

Line separation character (:)

Objects Create Object
Operators +, -, *, /, ^, Mod

Integer Division (\)

Negation (-)

String concatenation (&)

=, <>, <, >, <=, >=, Is

Not, And, Or, Xor

Eqv, Imp

Options Option Explicit
Procedures Function, Sub

Exit Function, Exit Sub

Call

ByVal, ByRef

Strings Asc, AscB, AscW

Chr, ChrB, ChrW

Instr, InStrB

Len, LenB

LCase, UCase

Left, LeftB

Mid, MidB

Right, RightB

Space(number)

StrComp

String(number, character)

Trim, LTrim, RTrim

Variables Procedure-level:

Dim, Static

Module-level:

Private, Dim

Variants IsArray

IsDate, IsEmpty, IsError

IsNull, IsNumeric, IsObject

VarType

Kirtan Patel replied to sai prasanth on 06-Apr-11 08:55 AM
Vb. script is developed by Microsoft and JavaScript is develop by Netscape corporation
vb script is now days nobody using in browsers .
feature Javascript VBScript
Object-Oriented: Very powerul and easy to create custom object classes Now supported with version 5+ CLASS construct, but is comparatively less powerful and syntax is much more verbose
Object-Based: More object-based, wraps core functionality in intrinsic objects like Date, Math, Number, String, and Array Less object-based, dumps functionality into global functions
Optional procedure arguments: Supported Not supported!
Getter/Setter properties: http://blog.throbs.net/ct.ashx?id=8cf4ab77-b7af-4e99-a6ca-b32c6e70731c&url=http%3a%2f%2fblog.throbs.net%2farchive%2f2005%2f04%2f01%2f167.aspx Supported
Dialog/User-input support: None built-in, depends on the current object model (e.g. window.alert/prompt/confirm, or WScript.Echo/popup). Has powerful native Msgbox and Inputbox functions.
Convenience tools (aka synactical sugar): Few (escape/unescape?) Plenty (Explicit Conversions, Formatting, Dates, Strings)
Date Manipulation: Difficult (hence the need for a Javascript Date library Easy (see convenience tools)
Leftovers/Quirks:
• Has ternary operator (e.g. var foo= true ? 'bar' : 'grep';
• No line-break characters in constants!
• No ternary operator and no IIF function like VB (but a custom IIF can be added).
General strength Powerful, more "nuts&bolts" Easy-to-learn, more common functionality built-in
General weakness Some common tasks are much too inconvenient Verbose, disorganized, weak OO capabilities

div v replied to sai prasanth on 06-Apr-11 08:58 AM
Comparison of JavaScript and VBScript
 
Similarities
 
   1. Both languages are easy to learn and do not require any expensive development tools
   2. Both can be used to enhance web pages
   3. They run on client machines and can substitute CGI programs to reduce server loads
   4. Both can abuse and run malicious scripts on clients' machines
 
Differences
 
   1. JavaScript is the default scripting language for browsers but VBScript must be specified as the scripting language.
   2. JavaScript has cross-platform support from all popular browsers while VBScript is supported MS IE only. VBScripters would thus loose a sizable audience.
   3. One of the most significant issues with JavaScript is that there were different releases of the language since its inception (version 1.0). Similarly, different versions of browsers exist on users machines. Therefore, code written for one version may not necessarily work on another. More testing would be necessary thus, development time increases.
   4. JavaScript is case sensitive but VBScript is not this would not be prone to as many syntax errors.<
   5. JavaScript uses the same character for concatenation as it does for addition (the + character) while the '&' concatenating character is used in VBScript. This is another source of errors in JavaScript.

ref :http://blog.throbs.net/default,date,2005-06-13.aspx