www.pickatutorial.com Computer Tutorials
Top eBooks: C/C++ | C# | Android | Mathematics | Database | Cloud | Graphics | Networking | Oracle | Hardware | AI
Top Tutorials: C/C++ | C#.NET | PHP MySQL | Java | Java Script | jQuery | HTML | xHTML | HTML5 | VB Script| CSS
Lessons VBScript Basics Bookmark and Share
Tutorial Home
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Lesson 13
Lesson 14
In this lesson we will learn some basics of VBScript, that will help us throughout this tutorial.

Where to Insert Scripts in an HTML page?
We have the liberty to insert VBScript code, in an HTML page, at any / all of the following locations:
  • Within the header tags i.e. <head> and </head>.
  • Within the bHTML document's body i.e. between the <body> and </body>

VBScript Comments:
Comments are very useful to leave notes in code. Leaving comments in code is a good programming practice. Comments are often added in the code to make it more readable and understandable.

Like other programming languages VBScript also support the insertion of comments in the code and unlike many other programming languages, VBScript only supports Single Line Comments. Any line in a VBScript code that starts with an apostrophe (') is treated as a comment line and is not processed as code by the VBScript interpreter.

Here is an example:

<script type="text/vbscript">
' the following line declares a variable
Dim age
' the following line assings a vaule to our variable hello
age = 20
' the following line prints the text

How to mark the end of a line in VBScript?
In VBScript a newline symbolizes the end of a line. However, sometimes our lines of code become so longer that we need to break some of them into multiple lines, to make them more readable. To ensure that such division does not affect the output, we use the underscore character (_) at the end of a line to indicate that the following line is also part of the current line.

<script type="text/vbscript">
test = 3 + 4_
+ 87

The VBScript interpreter would now process the above three lines as a single line of code. For now just concentrate on the use of the (_), the rest of the things will be discussed in the coming lessons.
Next >>> Lesson No. 4: VBScript Variables

Home - Advertise - Contact - Disclaimer - About Us
© Since 2006 pickatutorial.com -- All Rights Reserved.