SlideShare a Scribd company logo
Aamir Sohail
Web Technologies
Department Of Computer Science
Govt Post Graduate College Dargai
1
 VB Script stands for Visual Basic Script and it is
a light version of Microsoft Visual Basic.
 The syntax of VBScript is very similar to that of
Visual Basic.
 VBScript was developed by Microsoft with the
intention of developing dynamic web pages. 
Aamir Sohail2
 if you want your webpage to be more lively and
interactive, then you can incorporate VBScript in
your code.
 VBScript is just a scripting language.
 So, it cannot run its code on its own.
 It needs a bigger programming language to host it.
3
 VBScript is a lightweight scripting language, which
has a lightning fast interpreter.
 VBScript, for the most part, is case insensitive. It
has a very simple syntax, easy to learn and to
implement.
Aamir Sohail4
 Right now, there are 3 environments where VB
Script can run.
 IIS (Internet Information Server) – Microsoft’s web
server
 WSH (Windows Script Host)– The native hosting
environment of the Windows OS
 IE (Internet Explorer)– The simplest hosting
environment we can use to run VBScripts
Aamir Sohail5
 VBScript can be used as follows:
◦ Input Validation
◦ Mouse Rollover Effects
◦ Popup Windows
◦ Dynamic Contents
◦ User Interaction
Aamir Sohail6
 Web Pages
◦ VBScript can be used as client side scripting. It can be
embedded in HTML document to add interactive
functionality to web pages. It can be used for data
validation and user interaction at the client-end.
7
The applications that use VBScript are called Host
applications. The most common host applications
are as follows.
• Internet Explorer
• Internet Information Server
• Outlook uses VBScript as its Macro language
• Windows Scripting Host
Aamir Sohail8
 easy to learn and use
 minimum programming knowledge or experience
required
 allow complex tasks to be performed in relatively
few steps
 allow simple creation and editing in a variety of
text editors
 allow the addition of dynamic and interactive
activities to web pages
 editing and running code is fast.

Aamir Sohail9
 The main disadvantage of VBScript is that most
browsers except Internet Explorer will not process
VBScript code.
 if your site has visitors who use a web browser other
than Internet Explorer like Chrome, Firefox or Opera,
then VBScript will not be useful.
Aamir Sohail10
 Moreover, VBScript will not run on computers
that run on operating systems other than
Microsoft Windows including Linux, Mac etc.
 Like any other scripting language, VBScript has
gone through many changes over the years.
Aamir Sohail11
 VBScript code is embedded into HMTL document
using the SCRIPT tag. The <SCRIPT> tag is used
to inform browser about the start of VBScript
statements. The <SCRIPT> tag indicates the
beginning of scripting code and </SCRIPT> tah
indicates the end of scripting code.
<SCRIPT language=“VBScript”>
</SCRIPT>
Aamir Sohail12
 VBScript uses an object called Document.
 This object manages many instruction of VBScript.
 It can be used is to display a string on the screen.
a string is the next that is displayed in the
browser. It is displayed by using the function
Write.
 The Syntax of Write function of Document Object
is as Follows.
Document.Write(string)
Aamir Sohail13
The string can be constant written in double qoutes
or a variable. An example of Document.Write()
function is as follows:
<SCRIPT language=“VBScript”>
Document.Write(“VBScrip
Statement”)
</SCRIPT>
Aamir Sohail14
 Variable is a named memory location used to hold
a value that can be changed during the script
execution.
 The value of variable may changes during the
program execution but the name of the variable
cannot be changed.
Aamir Sohail15
The name of variable is given by the user at design
time. It may consist of alphabetic and numeric
digits. The name of variable should ne meaningful
and simple.
For example, if you have to store names of students
or salaries of employees, you will be using
variables named students or salaries.
Aamir Sohail16
 Following are some rules for declaring variables:
• Variable Name must begin with an alphabet. The
variables 9minute, #home, and 2kg are invalid.
• A variable name may include letters, number and
Underscore(_).
• Variable names cannot exceed 255 characters.
• Variables Should NOT contain a period(.)
• Variable Names should be unique in the declared
context.
Aamir Sohail17
• Blank Spaces are not allowed on the variable
name. the variable “my book” and “your car” are
invalid.
• Both upper and lowercase are allowed in variable
name.
• A reserved word cannot be used as a variable
name.
Aamir Sohail18
 Some examples of valid variables are as follows:
 Marks
 Home12
 My_Car
 F_name
Aamir Sohail19
Values are assigned similar to an algebraic expression.
The variable name on the left hand side followed by an
equal to (=) symbol and then its value on the right hand
side.
Rules:
The numeric values should be declared without double
quotes.
Aamir Sohail20
The String values should be enclosed within
doublequotes(")
Date and Time variables should be enclosed
within hash symbol(#)
Following are the examples
Aamir Sohail21
 The value 25 is assigned to the variable. Value1 =
25
 A String Value ‘VBScript’ is assigned to the
variable StrValue.
StrValue = “VBScript”
 The date 01/01/2020 is assigned to the variable
DToday.
Date1 =#01/01/2020#
 A Specific Time Stamp is assigned to a variable in
the below example.
 Time1 = #12:30:44 PM##
Aamir Sohail22
The variable in VBScript are declared using Dim
Keyword. Din stands for dimension, the syntax for
declaring variable is as follows:
Dim VarName
Here, VarName is variable name. VBScript has only
one data type called variant, it can store different
types of data such as string, integers, floating
point and numbers etc
Aamir Sohail23
VBScript interprets a variant according to the value
stored in it.
For example, a variant is treated as a number if it
contains numeric value. Similarly, a variable is
treated as string if It contains string value.
Aamir Sohail24
The option explicit is used to ensure that all
variables are declared before they are used.
The option explicit statement is included before any
HTML text or script commands.
Aamir Sohail25
<SCRIPT language=“VBScript”>
Option Explicit
Dim myVar
</SCRIPT>
Aamir Sohail26
<SCRIPT language=“VBScript”>
n = 10
document.write(n)
</SCRIPT>
This will appear with the value 10.
Aamir Sohail27
<SCRIPT language=“VBScript”>
Option Explicit
n = 10
document.write(n)
</SCRIPT>
The output will disappear due to the error.
Aamir Sohail28
<SCRIPT language=“VBScript”>
Option explicit
Dim n
n = 10
document.write(n)
</SCRIPT>
The error will be removed and the result will appear
again correctly.
Aamir Sohail29
In simple words,  4 + 5 is equal to 9. Here, 4 and 5
are called operands and + is called operator.
VBScript language supports following types of
operators:
VBScript provides different mathematical operators
to manipulate data and perform calculations that
are as follows:
Aamir Sohail30
Assume variable A holds 5 and variable B holds 10,
then:
Aamir Sohail31
There are following comparison operators supported by
VBScript language.
Assume variable A holds 10 and variable B holds 20, then:
Aamir Sohail32
There are following Concatenation operators supported by
VBScript language:
Assume variable A holds 5 and variable B holds 10 then:
Aamir Sohail33
Comments are the part of script that are not
executed. Comment are actually notes about
different lines of code that explain the purpose of
the code.
Comment can be added anywhere in the code.
In VBScript, comments starts with an single (‘).
Aamir Sohail34
A single (‘) Quote is used to tell the browser that
ignore statements that follow the symbol while
processing the code.
Following line is an example of VBScript Comment
‘Hi…!!! This is an example of comment

Aamir Sohail35
A function is a group of reusable code which can be
called anywhere in your program. This eliminates
the need of writing same code over and over
again.
This will enable programmers to divide a big
program into a number of small and manageable
functions.
Aamir Sohail36
Before we use a function, we need to define that
particular function.
The most common way to define a function in
VBScript is by using the Function keyword,
followed by a unique function name and it may or
may not carry a list of parameters and a statement
with a End Function keyword, which indicates the
end of the function.
Aamir Sohail37
The basic syntax is shown below:
Function Functionname(parameter-list)
statement 1
statement 2
statement 3
.
.
.
statement n
End Function
Aamir Sohail38
To invoke a function somewhere later in the script,
you would simple need to write the name of that
function with the Call keyword.
Function Functio01(parameter-list)
statement 1
End Function
Call Function01
Aamir Sohail39
Decision making allows programmers to control the
execution flow of a script or one of its sections.
The execution is governed by one or more
conditional statements.
Following is the general form of a typical decision
making structure found in most of the
programming languages:
Aamir Sohail40
If the condition is said to be True, the statements
under If condition(s) are Executed.
If the Condition is said to be False, the statements
after the If loop are executed.
Aamir Sohail41
<script language="vbscript">
Dim a : a = 20
Dim b : b = 10
If a > b
Then
Document.write "a is Greater than b"
End If
</script>
Aamir Sohail42
If the condition is said to be True, the statements
under If condition(s) are Executed.
If the Condition is said to be False, the statements
under Else Part would be executed.
Aamir Sohail43
Dim a : a = 5
Dim b : b = 25
If a > b
Then
Document.write "a is Greater“
Else
Document.write "b is Greater“
End If
Aamir Sohail44
Aamir Sohail45
Thank You…!!!

More Related Content

What's hot

Vbscript
VbscriptVbscript
Vbscript
VARSHAKUMARI49
 
Introduction to distributed database
Introduction to distributed databaseIntroduction to distributed database
Introduction to distributed database
Sonia Panesar
 
Active x control
Active x controlActive x control
Active x control
Amandeep Kaur
 
Textbox n label
Textbox n labelTextbox n label
Textbox n label
chauhankapil
 
GRID VIEW PPT
GRID VIEW PPTGRID VIEW PPT
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architecture
Yisal Khan
 
Peephole optimization techniques in compiler design
Peephole optimization techniques in compiler designPeephole optimization techniques in compiler design
Peephole optimization techniques in compiler design
Anul Chaudhary
 
Namespaces in C#
Namespaces in C#Namespaces in C#
Namespaces in C#
yogita kachve
 
Introduction to php web programming - sessions and cookies
Introduction to php   web programming - sessions and cookiesIntroduction to php   web programming - sessions and cookies
Introduction to php web programming - sessions and cookies
baabtra.com - No. 1 supplier of quality freshers
 
Functions in javascript
Functions in javascriptFunctions in javascript
Session tracking in servlets
Session tracking in servletsSession tracking in servlets
Session tracking in servlets
vishal choudhary
 
Xml
XmlXml
Sdi & mdi
Sdi & mdiSdi & mdi
Sdi & mdi
BABAVALI S
 
Form Processing In Php
Form Processing In PhpForm Processing In Php
Form Processing In Php
Harit Kothari
 
Common dialog control
Common dialog controlCommon dialog control
Common dialog control
Soumya Vijoy
 
JavaScript: Events Handling
JavaScript: Events HandlingJavaScript: Events Handling
JavaScript: Events Handling
Yuriy Bezgachnyuk
 
Difference between Homogeneous and Heterogeneous
Difference between Homogeneous  and    HeterogeneousDifference between Homogeneous  and    Heterogeneous
Difference between Homogeneous and Heterogeneous
Faraz Qaisrani
 
Html tags
Html tagsHtml tags
Relational algebra in DBMS
Relational algebra in DBMSRelational algebra in DBMS
Relational algebra in DBMS
Arafat Hossan
 
embedded-static-&dynamic
embedded-static-&dynamicembedded-static-&dynamic
embedded-static-&dynamic
Saranya Natarajan
 

What's hot (20)

Vbscript
VbscriptVbscript
Vbscript
 
Introduction to distributed database
Introduction to distributed databaseIntroduction to distributed database
Introduction to distributed database
 
Active x control
Active x controlActive x control
Active x control
 
Textbox n label
Textbox n labelTextbox n label
Textbox n label
 
GRID VIEW PPT
GRID VIEW PPTGRID VIEW PPT
GRID VIEW PPT
 
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architecture
 
Peephole optimization techniques in compiler design
Peephole optimization techniques in compiler designPeephole optimization techniques in compiler design
Peephole optimization techniques in compiler design
 
Namespaces in C#
Namespaces in C#Namespaces in C#
Namespaces in C#
 
Introduction to php web programming - sessions and cookies
Introduction to php   web programming - sessions and cookiesIntroduction to php   web programming - sessions and cookies
Introduction to php web programming - sessions and cookies
 
Functions in javascript
Functions in javascriptFunctions in javascript
Functions in javascript
 
Session tracking in servlets
Session tracking in servletsSession tracking in servlets
Session tracking in servlets
 
Xml
XmlXml
Xml
 
Sdi & mdi
Sdi & mdiSdi & mdi
Sdi & mdi
 
Form Processing In Php
Form Processing In PhpForm Processing In Php
Form Processing In Php
 
Common dialog control
Common dialog controlCommon dialog control
Common dialog control
 
JavaScript: Events Handling
JavaScript: Events HandlingJavaScript: Events Handling
JavaScript: Events Handling
 
Difference between Homogeneous and Heterogeneous
Difference between Homogeneous  and    HeterogeneousDifference between Homogeneous  and    Heterogeneous
Difference between Homogeneous and Heterogeneous
 
Html tags
Html tagsHtml tags
Html tags
 
Relational algebra in DBMS
Relational algebra in DBMSRelational algebra in DBMS
Relational algebra in DBMS
 
embedded-static-&dynamic
embedded-static-&dynamicembedded-static-&dynamic
embedded-static-&dynamic
 

Similar to Vb script

Advanced+qtp+open+order
Advanced+qtp+open+orderAdvanced+qtp+open+order
Advanced+qtp+open+order
Ramu Palanki
 
Advanced Qtp Book
Advanced Qtp BookAdvanced Qtp Book
Advanced Qtp Book
guestd9317c
 
has any rows using Count(). This way, you avoid the CS8604 error related to p...
has any rows using Count(). This way, you avoid the CS8604 error related to p...has any rows using Count(). This way, you avoid the CS8604 error related to p...
has any rows using Count(). This way, you avoid the CS8604 error related to p...
Anwar Patel
 
Qtp Scripts
Qtp ScriptsQtp Scripts
Qtp Scripts
G.C Reddy
 
Advanced Qtp Book
Advanced Qtp BookAdvanced Qtp Book
Advanced Qtp Book
G.C Reddy
 
Vb script
Vb scriptVb script
Vb script
mcatahir947
 
Vbs
VbsVbs
04-JS.pptx
04-JS.pptx04-JS.pptx
04-JS.pptx
RazanMazen4
 
04-JS.pptx
04-JS.pptx04-JS.pptx
04-JS.pptx
RazanMazen4
 
04-JS.pptx
04-JS.pptx04-JS.pptx
04-JS.pptx
RazanMazen4
 
Web programming
Web programmingWeb programming
Web programming
Leo Mark Villar
 
VB Script Overview
VB Script OverviewVB Script Overview
VB Script Overview
Praveen Gorantla
 
Active server pages
Active server pagesActive server pages
Active server pages
student
 
Computer fundamentals
Computer fundamentalsComputer fundamentals
Computer fundamentals
sameer sheikh
 
Javascript tutorial basic for starter
Javascript tutorial basic for starterJavascript tutorial basic for starter
Javascript tutorial basic for starter
Marcello Harford
 
Java script
Java scriptJava script
Java script
Gayane Aslanyan
 
08. session 08 intoduction to javascript
08. session 08   intoduction to javascript08. session 08   intoduction to javascript
08. session 08 intoduction to javascript
Phúc Đỗ
 
ASP.NET Basics
ASP.NET Basics ASP.NET Basics
3. Java Script
3. Java Script3. Java Script
3. Java Script
Jalpesh Vasa
 
Qtp - Introduction to fundamentals of vbscript
Qtp - Introduction to fundamentals of vbscriptQtp - Introduction to fundamentals of vbscript
Qtp - Introduction to fundamentals of vbscript
Vibrant Technologies & Computers
 

Similar to Vb script (20)

Advanced+qtp+open+order
Advanced+qtp+open+orderAdvanced+qtp+open+order
Advanced+qtp+open+order
 
Advanced Qtp Book
Advanced Qtp BookAdvanced Qtp Book
Advanced Qtp Book
 
has any rows using Count(). This way, you avoid the CS8604 error related to p...
has any rows using Count(). This way, you avoid the CS8604 error related to p...has any rows using Count(). This way, you avoid the CS8604 error related to p...
has any rows using Count(). This way, you avoid the CS8604 error related to p...
 
Qtp Scripts
Qtp ScriptsQtp Scripts
Qtp Scripts
 
Advanced Qtp Book
Advanced Qtp BookAdvanced Qtp Book
Advanced Qtp Book
 
Vb script
Vb scriptVb script
Vb script
 
Vbs
VbsVbs
Vbs
 
04-JS.pptx
04-JS.pptx04-JS.pptx
04-JS.pptx
 
04-JS.pptx
04-JS.pptx04-JS.pptx
04-JS.pptx
 
04-JS.pptx
04-JS.pptx04-JS.pptx
04-JS.pptx
 
Web programming
Web programmingWeb programming
Web programming
 
VB Script Overview
VB Script OverviewVB Script Overview
VB Script Overview
 
Active server pages
Active server pagesActive server pages
Active server pages
 
Computer fundamentals
Computer fundamentalsComputer fundamentals
Computer fundamentals
 
Javascript tutorial basic for starter
Javascript tutorial basic for starterJavascript tutorial basic for starter
Javascript tutorial basic for starter
 
Java script
Java scriptJava script
Java script
 
08. session 08 intoduction to javascript
08. session 08   intoduction to javascript08. session 08   intoduction to javascript
08. session 08 intoduction to javascript
 
ASP.NET Basics
ASP.NET Basics ASP.NET Basics
ASP.NET Basics
 
3. Java Script
3. Java Script3. Java Script
3. Java Script
 
Qtp - Introduction to fundamentals of vbscript
Qtp - Introduction to fundamentals of vbscriptQtp - Introduction to fundamentals of vbscript
Qtp - Introduction to fundamentals of vbscript
 

More from Aamir Sohail

Presentation on java servlets
Presentation on java servletsPresentation on java servlets
Presentation on java servlets
Aamir Sohail
 
Presentation on html, css
Presentation on html, cssPresentation on html, css
Presentation on html, css
Aamir Sohail
 
Line clipping algorithm (Detailed)
Line clipping algorithm (Detailed)Line clipping algorithm (Detailed)
Line clipping algorithm (Detailed)
Aamir Sohail
 
Hash table in data structure and algorithm
Hash table in data structure and algorithmHash table in data structure and algorithm
Hash table in data structure and algorithm
Aamir Sohail
 
Infromation securiity
Infromation securiityInfromation securiity
Infromation securiity
Aamir Sohail
 
Network Security Policies
Network Security PoliciesNetwork Security Policies
Network Security Policies
Aamir Sohail
 
Scheduling and scheduling personnel
Scheduling and scheduling personnelScheduling and scheduling personnel
Scheduling and scheduling personnel
Aamir Sohail
 

More from Aamir Sohail (7)

Presentation on java servlets
Presentation on java servletsPresentation on java servlets
Presentation on java servlets
 
Presentation on html, css
Presentation on html, cssPresentation on html, css
Presentation on html, css
 
Line clipping algorithm (Detailed)
Line clipping algorithm (Detailed)Line clipping algorithm (Detailed)
Line clipping algorithm (Detailed)
 
Hash table in data structure and algorithm
Hash table in data structure and algorithmHash table in data structure and algorithm
Hash table in data structure and algorithm
 
Infromation securiity
Infromation securiityInfromation securiity
Infromation securiity
 
Network Security Policies
Network Security PoliciesNetwork Security Policies
Network Security Policies
 
Scheduling and scheduling personnel
Scheduling and scheduling personnelScheduling and scheduling personnel
Scheduling and scheduling personnel
 

Recently uploaded

GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Codeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdfCodeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdf
Semiosis Software Private Limited
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 

Recently uploaded (20)

GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Codeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdfCodeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdf
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 

Vb script

  • 1. Aamir Sohail Web Technologies Department Of Computer Science Govt Post Graduate College Dargai 1
  • 2.  VB Script stands for Visual Basic Script and it is a light version of Microsoft Visual Basic.  The syntax of VBScript is very similar to that of Visual Basic.  VBScript was developed by Microsoft with the intention of developing dynamic web pages.  Aamir Sohail2
  • 3.  if you want your webpage to be more lively and interactive, then you can incorporate VBScript in your code.  VBScript is just a scripting language.  So, it cannot run its code on its own.  It needs a bigger programming language to host it. 3
  • 4.  VBScript is a lightweight scripting language, which has a lightning fast interpreter.  VBScript, for the most part, is case insensitive. It has a very simple syntax, easy to learn and to implement. Aamir Sohail4
  • 5.  Right now, there are 3 environments where VB Script can run.  IIS (Internet Information Server) – Microsoft’s web server  WSH (Windows Script Host)– The native hosting environment of the Windows OS  IE (Internet Explorer)– The simplest hosting environment we can use to run VBScripts Aamir Sohail5
  • 6.  VBScript can be used as follows: ◦ Input Validation ◦ Mouse Rollover Effects ◦ Popup Windows ◦ Dynamic Contents ◦ User Interaction Aamir Sohail6
  • 7.  Web Pages ◦ VBScript can be used as client side scripting. It can be embedded in HTML document to add interactive functionality to web pages. It can be used for data validation and user interaction at the client-end. 7
  • 8. The applications that use VBScript are called Host applications. The most common host applications are as follows. • Internet Explorer • Internet Information Server • Outlook uses VBScript as its Macro language • Windows Scripting Host Aamir Sohail8
  • 9.  easy to learn and use  minimum programming knowledge or experience required  allow complex tasks to be performed in relatively few steps  allow simple creation and editing in a variety of text editors  allow the addition of dynamic and interactive activities to web pages  editing and running code is fast.  Aamir Sohail9
  • 10.  The main disadvantage of VBScript is that most browsers except Internet Explorer will not process VBScript code.  if your site has visitors who use a web browser other than Internet Explorer like Chrome, Firefox or Opera, then VBScript will not be useful. Aamir Sohail10
  • 11.  Moreover, VBScript will not run on computers that run on operating systems other than Microsoft Windows including Linux, Mac etc.  Like any other scripting language, VBScript has gone through many changes over the years. Aamir Sohail11
  • 12.  VBScript code is embedded into HMTL document using the SCRIPT tag. The <SCRIPT> tag is used to inform browser about the start of VBScript statements. The <SCRIPT> tag indicates the beginning of scripting code and </SCRIPT> tah indicates the end of scripting code. <SCRIPT language=“VBScript”> </SCRIPT> Aamir Sohail12
  • 13.  VBScript uses an object called Document.  This object manages many instruction of VBScript.  It can be used is to display a string on the screen. a string is the next that is displayed in the browser. It is displayed by using the function Write.  The Syntax of Write function of Document Object is as Follows. Document.Write(string) Aamir Sohail13
  • 14. The string can be constant written in double qoutes or a variable. An example of Document.Write() function is as follows: <SCRIPT language=“VBScript”> Document.Write(“VBScrip Statement”) </SCRIPT> Aamir Sohail14
  • 15.  Variable is a named memory location used to hold a value that can be changed during the script execution.  The value of variable may changes during the program execution but the name of the variable cannot be changed. Aamir Sohail15
  • 16. The name of variable is given by the user at design time. It may consist of alphabetic and numeric digits. The name of variable should ne meaningful and simple. For example, if you have to store names of students or salaries of employees, you will be using variables named students or salaries. Aamir Sohail16
  • 17.  Following are some rules for declaring variables: • Variable Name must begin with an alphabet. The variables 9minute, #home, and 2kg are invalid. • A variable name may include letters, number and Underscore(_). • Variable names cannot exceed 255 characters. • Variables Should NOT contain a period(.) • Variable Names should be unique in the declared context. Aamir Sohail17
  • 18. • Blank Spaces are not allowed on the variable name. the variable “my book” and “your car” are invalid. • Both upper and lowercase are allowed in variable name. • A reserved word cannot be used as a variable name. Aamir Sohail18
  • 19.  Some examples of valid variables are as follows:  Marks  Home12  My_Car  F_name Aamir Sohail19
  • 20. Values are assigned similar to an algebraic expression. The variable name on the left hand side followed by an equal to (=) symbol and then its value on the right hand side. Rules: The numeric values should be declared without double quotes. Aamir Sohail20
  • 21. The String values should be enclosed within doublequotes(") Date and Time variables should be enclosed within hash symbol(#) Following are the examples Aamir Sohail21
  • 22.  The value 25 is assigned to the variable. Value1 = 25  A String Value ‘VBScript’ is assigned to the variable StrValue. StrValue = “VBScript”  The date 01/01/2020 is assigned to the variable DToday. Date1 =#01/01/2020#  A Specific Time Stamp is assigned to a variable in the below example.  Time1 = #12:30:44 PM## Aamir Sohail22
  • 23. The variable in VBScript are declared using Dim Keyword. Din stands for dimension, the syntax for declaring variable is as follows: Dim VarName Here, VarName is variable name. VBScript has only one data type called variant, it can store different types of data such as string, integers, floating point and numbers etc Aamir Sohail23
  • 24. VBScript interprets a variant according to the value stored in it. For example, a variant is treated as a number if it contains numeric value. Similarly, a variable is treated as string if It contains string value. Aamir Sohail24
  • 25. The option explicit is used to ensure that all variables are declared before they are used. The option explicit statement is included before any HTML text or script commands. Aamir Sohail25
  • 27. <SCRIPT language=“VBScript”> n = 10 document.write(n) </SCRIPT> This will appear with the value 10. Aamir Sohail27
  • 28. <SCRIPT language=“VBScript”> Option Explicit n = 10 document.write(n) </SCRIPT> The output will disappear due to the error. Aamir Sohail28
  • 29. <SCRIPT language=“VBScript”> Option explicit Dim n n = 10 document.write(n) </SCRIPT> The error will be removed and the result will appear again correctly. Aamir Sohail29
  • 30. In simple words,  4 + 5 is equal to 9. Here, 4 and 5 are called operands and + is called operator. VBScript language supports following types of operators: VBScript provides different mathematical operators to manipulate data and perform calculations that are as follows: Aamir Sohail30
  • 31. Assume variable A holds 5 and variable B holds 10, then: Aamir Sohail31
  • 32. There are following comparison operators supported by VBScript language. Assume variable A holds 10 and variable B holds 20, then: Aamir Sohail32
  • 33. There are following Concatenation operators supported by VBScript language: Assume variable A holds 5 and variable B holds 10 then: Aamir Sohail33
  • 34. Comments are the part of script that are not executed. Comment are actually notes about different lines of code that explain the purpose of the code. Comment can be added anywhere in the code. In VBScript, comments starts with an single (‘). Aamir Sohail34
  • 35. A single (‘) Quote is used to tell the browser that ignore statements that follow the symbol while processing the code. Following line is an example of VBScript Comment ‘Hi…!!! This is an example of comment  Aamir Sohail35
  • 36. A function is a group of reusable code which can be called anywhere in your program. This eliminates the need of writing same code over and over again. This will enable programmers to divide a big program into a number of small and manageable functions. Aamir Sohail36
  • 37. Before we use a function, we need to define that particular function. The most common way to define a function in VBScript is by using the Function keyword, followed by a unique function name and it may or may not carry a list of parameters and a statement with a End Function keyword, which indicates the end of the function. Aamir Sohail37
  • 38. The basic syntax is shown below: Function Functionname(parameter-list) statement 1 statement 2 statement 3 . . . statement n End Function Aamir Sohail38
  • 39. To invoke a function somewhere later in the script, you would simple need to write the name of that function with the Call keyword. Function Functio01(parameter-list) statement 1 End Function Call Function01 Aamir Sohail39
  • 40. Decision making allows programmers to control the execution flow of a script or one of its sections. The execution is governed by one or more conditional statements. Following is the general form of a typical decision making structure found in most of the programming languages: Aamir Sohail40
  • 41. If the condition is said to be True, the statements under If condition(s) are Executed. If the Condition is said to be False, the statements after the If loop are executed. Aamir Sohail41
  • 42. <script language="vbscript"> Dim a : a = 20 Dim b : b = 10 If a > b Then Document.write "a is Greater than b" End If </script> Aamir Sohail42
  • 43. If the condition is said to be True, the statements under If condition(s) are Executed. If the Condition is said to be False, the statements under Else Part would be executed. Aamir Sohail43
  • 44. Dim a : a = 5 Dim b : b = 25 If a > b Then Document.write "a is Greater“ Else Document.write "b is Greater“ End If Aamir Sohail44