Learn basics of the VBScript – The VbScript Tutorial

VBScript is the scripting language and has the same power as JavaScript and JScript. It is widely used with the ActiveX controls. You can also use VBScript as the client scripting in the Internet Explorer browsers and as web server scripting in the IIS.

I have used VBScript in the Grapecity ‘s Active reports and office add-ins. If you have little knowledge of the scripting languages than it is easy to learn. I’ll try to show you all the basic of the VBScript in following parts.

What is this?
DataTypes, Variables and Arrays.
Operators and Statements.
Loops
How to use with HTML page
Methods and Functions
Date and Time functions
Data handling
Test your self

What is this?

I have said that VBScript is same as other scripting language like JavaScript (known for widely used in client scripting in web development) and JScript (Implemented by Microsoft). It is very familiar with the ActiveX controls (Internet Explorer browser support the ActiveX controls).

In HTML page

I am using the Internet Explorer to show you the use of the VBScript. See the following html page in which I am showing an client side (browser side) message just as ‘alert’ in JavaScript.

method or function in VBScript starts with the ‘Sub’ keyword and ends with the ‘End Sub’. msgbox() can be use to show a message to the user.

 
<html>
 <head>
  <title>Example of VBScript</title>
  <script language="vbscript">
  	sub window_OnLoad()
   	  msgBox("hello")
  	End Sub
  </script>
 </head>
<body>
Welcome to Authorcode
</body>
</html>

You must give the permission to allow run the script in the above html page on the Internet Explorer(Please check that). In HTML document VBScript code is written within the <script> and </script> tag pair and you also need to specify the language

let’s go to the next chapter: Data types, Variables and Array in VBScript