SlideShare a Scribd company logo
1 of 26
VB Script
    By:
    Satish Sukumaran
• VBScript stands for Visual Basic Scripting, is a scripting
language was launched by Microsoft in1996.

VB Scripting language is a lightweight programming
language.

VBScript can be used to write both client-side and
server-side scripting.
• VBScript supports only one Data type called ‘Variant’


•A Variant is a special type of data that can contain
different kinds of information, depending upon how it is
used.
•A variant behaves as a number when it is used in a
numeric context and as a string when used in string
context.
VBScript Variables
A variable is a "container" /Placeholder that refers to a memory
  location,that stores program information that may change at
  run time.

Variable Declaration:
Dim :Variable declared with Dim at script level are available
      To all procedures within the script.
Public: Variables are available to all procedures in all scripts.
Private: Variables are available only to the scripts in which they
         are declared.
Naming Rules:
       Must begin with an alphabetic character
       Cannot contain an embedded period
       Cannot exceed 255 characters
       Must be unique within its scope in which it is declared.
  Implicit Declaration:

   You can Assign a Value to variable directly (without declaring a
    variable). But not a good practice, because you may misspell the
    variable name in one or more places, causing unexpected result
    when your script is run.

   Option Explicit :Option Explicit to avoid incorrectly typing the name of
   an existing variable.
 Example  :
        Option explicit
        Dim var_ x
        var_x=1
Constants
 The values that do not alter during the entire
  execution of the program are called as constants.
 Const keyword is used to declare constants.
 It is necessary to initialize the Constant during its
  declaration.
 You cannot change the value of constants in later
  script.
Syntax:
  const x=1
  const my string=“This is my string”
Arrays
 A Variable containing single value is called scalar
  variable.
 Sometimes you want to assign more than one value to
  a single variable. Then you can create a variable that
  can contain a series of values. This is called an array
  variable.
Arrays (cont.)
 The declaration of an array variable uses parentheses ( )
  following the variable name.

Example:

dim names(2)

names(0)=“Ali“
names(1)=“Imran“
names(2)=“Khan"
Arrays (cont.)
 An array can be multi dimensional.


 There can be 60 (maximum) dimensions in an array.


 Multiple dimensions are declared by separating the
 numbers in the parentheses with commas.
Procedures
A Sub procedure:
 is a series of statements, enclosed by the Sub and End
  Sub statements
 can perform actions, but does not return a value
 can take arguments that are passed to it by a calling
  procedure
 without arguments, must include an empty set of
  parentheses ()
Procedures (Cont)
 Sub Keyword is Used to declare a procedure.
 End Sub Keyword is Used to defining the ending
  boundary of a procedure.
 Call Keyword is Used in order to invoke a procedure.

Syntax:
            Sub mysub()
                 some statements
            End Sub

            Call mysub()
Procedures (Cont)
 Procedure can take arguments that are passed to it by
 calling that procedure .

Syntax:
            Sub procedure name(arg1,arg2)
                  some statements
            End Sub

            Call mysub(value1,value2)
Functions
A Function procedure:
 is a series of statements, enclosed by the Function and
  End Function statements
 can perform actions and can return a value
 can take arguments that are passed to it by a calling
  procedure
 without arguments, must include an empty set of
  parentheses ()
 returns a value by assigning a value to its name
Functions (Cont)
 Function Keyword is Used to declare a Function.
 End Function Keyword is Used to defining the ending
  boundary of a Function.
 <Function Name> is Used in order to invoke a Function.

Syntax:
             Function myfunc()
                  myfunc=value
                   some statements
             End Function

             myfunc
If Condition
 Using If statement we can execute a single or block of
  statements when a condition
    is true.
 Ex:-
                    If i=0 Then
                       msgbox "Hello"
                         i=i+1
                    End If
If-Else Condition
Execute a block of statement when condition is true,
  otherwise execute another block of statements when
  condition false.

If i=2 then
msgbox”Hello world”
Else
Msgbox”Thank You”
End if
If-Elseif Condition (cont.)
 Decide among several alternates.


 if payment="Cash" then
 msgbox "You are going to pay cash!"
 elseif payment="Visa" then
 msgbox "You are going to pay with visa."
 elseif payment="AmEx" then
 msgbox "You are going to pay with American Express." else
 msgbox "Unknown method of payment.“
 end If
Select Case Condition
 Using this statement one of several groups of statements
  are executed based on the expression value. Example: You
  can use the SELECT statement if you want to select one of
  many blocks of code to execute.
  Select case payment
    Case " Cash "
    msgbox " You are going to pay cash "
   Case " Visa "
   msgbox " You are going to pay with Visa "
   Case " AmEx"
   msgbox " You are going to pay with American Express"
   Case Else
   msgbox " Unknown method of payment"
  End Select
For Loop
  A For loop is used for situations when you need to do
  something over and over again until some condition
  statement fails.
Ex:-

 For count=0 to 3
     Print (count)
 Next
For Each Loop
 It is useful when you want to go through every element
  in an array but you do not know how many elements
  are there inside the array.
 Ex:-

 Dim a(2)
 a(0)= " Pen "
 a(1) =" Register"
 a(2)= " Copy"
 For Each item In a
   Print(item)
 Next
Do-while loop
 Do-while keywords are used to execute specified code
 for a set of times (until a condition remains true or a
 condition becomes false).

 Syntax

  Do While <Condition for loop>
    Some Statements
  Loop
Do-while loop (cont.)

 Do-While can also used in following syntax:


 Do
     some Statements
 Loop While i>10
Do-Until Loop
 Do – Until keyword is used for repeating some set of
 statements until a certain condition is true.

 Syntax:
      Do Until <Condition>
             some statmemts
      Loop
Do-Until Loop (cont.)
 Do-Until can also used in following syntax:


      Do
           some statements
      Loop Until <Condition>
Built in Functions
 VB Script provides several built in functions that can
 be used just by calling them.

 Few Examples:


 Date
 Time
 Int
Thank You !

More Related Content

What's hot

Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScriptShahDhruv21
 
javascript objects
javascript objectsjavascript objects
javascript objectsVijay Kalyan
 
Java Networking
Java NetworkingJava Networking
Java NetworkingSunil OS
 
ASP.NET 07 - Site Navigation
ASP.NET 07 - Site NavigationASP.NET 07 - Site Navigation
ASP.NET 07 - Site NavigationRandy Connolly
 
Java script errors &amp; exceptions handling
Java script  errors &amp; exceptions handlingJava script  errors &amp; exceptions handling
Java script errors &amp; exceptions handlingAbhishekMondal42
 
Authentication and Authorization in Asp.Net
Authentication and Authorization in Asp.NetAuthentication and Authorization in Asp.Net
Authentication and Authorization in Asp.NetShivanand Arur
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for DesignersR. Sosa
 
Data Type Conversion in C++
Data Type Conversion in C++Data Type Conversion in C++
Data Type Conversion in C++Danial Mirza
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to JavascriptAmit Tyagi
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.NetHitesh Santani
 
Lecture 1 introduction to vb.net
Lecture 1   introduction to vb.netLecture 1   introduction to vb.net
Lecture 1 introduction to vb.netMUKALU STEVEN
 
JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events WebStackAcademy
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScriptRavi Bhadauria
 

What's hot (20)

Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScript
 
javascript objects
javascript objectsjavascript objects
javascript objects
 
Java Networking
Java NetworkingJava Networking
Java Networking
 
Windowforms controls c#
Windowforms controls c#Windowforms controls c#
Windowforms controls c#
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 
Vb.net class notes
Vb.net class notesVb.net class notes
Vb.net class notes
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
ASP.NET 07 - Site Navigation
ASP.NET 07 - Site NavigationASP.NET 07 - Site Navigation
ASP.NET 07 - Site Navigation
 
Java script errors &amp; exceptions handling
Java script  errors &amp; exceptions handlingJava script  errors &amp; exceptions handling
Java script errors &amp; exceptions handling
 
Authentication and Authorization in Asp.Net
Authentication and Authorization in Asp.NetAuthentication and Authorization in Asp.Net
Authentication and Authorization in Asp.Net
 
Asp.net control
Asp.net controlAsp.net control
Asp.net control
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for Designers
 
C#.NET
C#.NETC#.NET
C#.NET
 
Data Type Conversion in C++
Data Type Conversion in C++Data Type Conversion in C++
Data Type Conversion in C++
 
Javascript essentials
Javascript essentialsJavascript essentials
Javascript essentials
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
 
Lecture 1 introduction to vb.net
Lecture 1   introduction to vb.netLecture 1   introduction to vb.net
Lecture 1 introduction to vb.net
 
JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScript
 

Viewers also liked

Intorudction into VBScript
Intorudction into VBScriptIntorudction into VBScript
Intorudction into VBScriptVitaliy Ganzha
 
Basic vbscript for qtp
Basic vbscript for qtpBasic vbscript for qtp
Basic vbscript for qtpCuong Tran Van
 
VBScript Tutorial
VBScript TutorialVBScript Tutorial
VBScript TutorialLeminy
 
QTP VB Script Trainings
QTP VB Script TrainingsQTP VB Script Trainings
QTP VB Script TrainingsAli Imran
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programmingRoger Argarin
 
JavaScript - An Introduction
JavaScript - An IntroductionJavaScript - An Introduction
JavaScript - An IntroductionManvendra Singh
 
visual basic for the beginner
visual basic for the beginnervisual basic for the beginner
visual basic for the beginnerSalim M
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)pbarasia
 
UFT An advance version of QTP
UFT  An advance version of QTPUFT  An advance version of QTP
UFT An advance version of QTPRita Singh
 
ملخص تقنية تصميم صفحات الويب - الوحدة الثالثة (الجزء الاول)
ملخص تقنية تصميم صفحات الويب - الوحدة الثالثة (الجزء الاول) ملخص تقنية تصميم صفحات الويب - الوحدة الثالثة (الجزء الاول)
ملخص تقنية تصميم صفحات الويب - الوحدة الثالثة (الجزء الاول) جامعة القدس المفتوحة
 

Viewers also liked (20)

Intorudction into VBScript
Intorudction into VBScriptIntorudction into VBScript
Intorudction into VBScript
 
vb script
vb scriptvb script
vb script
 
Basic vbscript for qtp
Basic vbscript for qtpBasic vbscript for qtp
Basic vbscript for qtp
 
Vb script
Vb scriptVb script
Vb script
 
VBScript Tutorial
VBScript TutorialVBScript Tutorial
VBScript Tutorial
 
QTP VB Script Trainings
QTP VB Script TrainingsQTP VB Script Trainings
QTP VB Script Trainings
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programming
 
Js ppt
Js pptJs ppt
Js ppt
 
JavaScript - An Introduction
JavaScript - An IntroductionJavaScript - An Introduction
JavaScript - An Introduction
 
VB Script Overview
VB Script OverviewVB Script Overview
VB Script Overview
 
Vb and asp.net
Vb and asp.netVb and asp.net
Vb and asp.net
 
visual basic for the beginner
visual basic for the beginnervisual basic for the beginner
visual basic for the beginner
 
Vbscript
VbscriptVbscript
Vbscript
 
Java script ppt
Java script pptJava script ppt
Java script ppt
 
Javascript
JavascriptJavascript
Javascript
 
Visual Basic 6.0
Visual Basic 6.0Visual Basic 6.0
Visual Basic 6.0
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)
 
UFT An advance version of QTP
UFT  An advance version of QTPUFT  An advance version of QTP
UFT An advance version of QTP
 
File System Object in QTP
File System Object in QTPFile System Object in QTP
File System Object in QTP
 
ملخص تقنية تصميم صفحات الويب - الوحدة الثالثة (الجزء الاول)
ملخص تقنية تصميم صفحات الويب - الوحدة الثالثة (الجزء الاول) ملخص تقنية تصميم صفحات الويب - الوحدة الثالثة (الجزء الاول)
ملخص تقنية تصميم صفحات الويب - الوحدة الثالثة (الجزء الاول)
 

Similar to VB Script

Javascript sivasoft
Javascript sivasoftJavascript sivasoft
Javascript sivasoftch samaram
 
Advanced+qtp+open+order
Advanced+qtp+open+orderAdvanced+qtp+open+order
Advanced+qtp+open+orderRamu Palanki
 
Implicit conversion and parameters
Implicit conversion and parametersImplicit conversion and parameters
Implicit conversion and parametersKnoldus Inc.
 
Advanced VB: Review of the basics
Advanced VB: Review of the basicsAdvanced VB: Review of the basics
Advanced VB: Review of the basicsrobertbenard
 
Advanced VB: Review of the basics
Advanced VB: Review of the basicsAdvanced VB: Review of the basics
Advanced VB: Review of the basicsrobertbenard
 
Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]srikanthbkm
 
Loops and conditional statements
Loops and conditional statementsLoops and conditional statements
Loops and conditional statementsSaad Sheikh
 
packaging procedures_and_state
packaging procedures_and_statepackaging procedures_and_state
packaging procedures_and_stateRajendran
 
Looping statements
Looping statementsLooping statements
Looping statementsJaya Kumari
 
Advanced Qtp Book
Advanced Qtp BookAdvanced Qtp Book
Advanced Qtp BookG.C Reddy
 
C++ control structure
C++ control structureC++ control structure
C++ control structurebluejayjunior
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript TutorialBui Kiet
 

Similar to VB Script (20)

Vb script tutorial
Vb script tutorialVb script tutorial
Vb script tutorial
 
Vb script tutorial
Vb script tutorialVb script tutorial
Vb script tutorial
 
Javascript sivasoft
Javascript sivasoftJavascript sivasoft
Javascript sivasoft
 
Vb script final pari
Vb script final pariVb script final pari
Vb script final pari
 
Javascript
JavascriptJavascript
Javascript
 
Typescript Basics
Typescript BasicsTypescript Basics
Typescript Basics
 
Advanced+qtp+open+order
Advanced+qtp+open+orderAdvanced+qtp+open+order
Advanced+qtp+open+order
 
Implicit conversion and parameters
Implicit conversion and parametersImplicit conversion and parameters
Implicit conversion and parameters
 
Advanced VB: Review of the basics
Advanced VB: Review of the basicsAdvanced VB: Review of the basics
Advanced VB: Review of the basics
 
Advanced VB: Review of the basics
Advanced VB: Review of the basicsAdvanced VB: Review of the basics
Advanced VB: Review of the basics
 
Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]
 
Loops and conditional statements
Loops and conditional statementsLoops and conditional statements
Loops and conditional statements
 
packaging procedures_and_state
packaging procedures_and_statepackaging procedures_and_state
packaging procedures_and_state
 
Looping statements
Looping statementsLooping statements
Looping statements
 
Advanced Qtp Book
Advanced Qtp BookAdvanced Qtp Book
Advanced Qtp Book
 
C++ Homework Help
C++ Homework HelpC++ Homework Help
C++ Homework Help
 
C++ control structure
C++ control structureC++ control structure
C++ control structure
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
 
Intake 37 2
Intake 37 2Intake 37 2
Intake 37 2
 
Programming in Arduino (Part 2)
Programming in Arduino  (Part 2)Programming in Arduino  (Part 2)
Programming in Arduino (Part 2)
 

Recently uploaded

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 

Recently uploaded (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

VB Script

  • 1. VB Script By: Satish Sukumaran
  • 2. • VBScript stands for Visual Basic Scripting, is a scripting language was launched by Microsoft in1996. VB Scripting language is a lightweight programming language. VBScript can be used to write both client-side and server-side scripting.
  • 3. • VBScript supports only one Data type called ‘Variant’ •A Variant is a special type of data that can contain different kinds of information, depending upon how it is used. •A variant behaves as a number when it is used in a numeric context and as a string when used in string context.
  • 4. VBScript Variables A variable is a "container" /Placeholder that refers to a memory location,that stores program information that may change at run time. Variable Declaration: Dim :Variable declared with Dim at script level are available To all procedures within the script. Public: Variables are available to all procedures in all scripts. Private: Variables are available only to the scripts in which they are declared.
  • 5. Naming Rules:  Must begin with an alphabetic character  Cannot contain an embedded period  Cannot exceed 255 characters  Must be unique within its scope in which it is declared. Implicit Declaration:  You can Assign a Value to variable directly (without declaring a variable). But not a good practice, because you may misspell the variable name in one or more places, causing unexpected result when your script is run. Option Explicit :Option Explicit to avoid incorrectly typing the name of an existing variable.  Example : Option explicit Dim var_ x var_x=1
  • 6. Constants  The values that do not alter during the entire execution of the program are called as constants.  Const keyword is used to declare constants.  It is necessary to initialize the Constant during its declaration.  You cannot change the value of constants in later script. Syntax: const x=1 const my string=“This is my string”
  • 7. Arrays  A Variable containing single value is called scalar variable.  Sometimes you want to assign more than one value to a single variable. Then you can create a variable that can contain a series of values. This is called an array variable.
  • 8. Arrays (cont.)  The declaration of an array variable uses parentheses ( ) following the variable name. Example: dim names(2) names(0)=“Ali“ names(1)=“Imran“ names(2)=“Khan"
  • 9. Arrays (cont.)  An array can be multi dimensional.  There can be 60 (maximum) dimensions in an array.  Multiple dimensions are declared by separating the numbers in the parentheses with commas.
  • 10. Procedures A Sub procedure:  is a series of statements, enclosed by the Sub and End Sub statements  can perform actions, but does not return a value  can take arguments that are passed to it by a calling procedure  without arguments, must include an empty set of parentheses ()
  • 11. Procedures (Cont)  Sub Keyword is Used to declare a procedure.  End Sub Keyword is Used to defining the ending boundary of a procedure.  Call Keyword is Used in order to invoke a procedure. Syntax: Sub mysub() some statements End Sub Call mysub()
  • 12. Procedures (Cont)  Procedure can take arguments that are passed to it by calling that procedure . Syntax: Sub procedure name(arg1,arg2) some statements End Sub Call mysub(value1,value2)
  • 13. Functions A Function procedure:  is a series of statements, enclosed by the Function and End Function statements  can perform actions and can return a value  can take arguments that are passed to it by a calling procedure  without arguments, must include an empty set of parentheses ()  returns a value by assigning a value to its name
  • 14. Functions (Cont)  Function Keyword is Used to declare a Function.  End Function Keyword is Used to defining the ending boundary of a Function.  <Function Name> is Used in order to invoke a Function. Syntax: Function myfunc() myfunc=value some statements End Function myfunc
  • 15. If Condition  Using If statement we can execute a single or block of statements when a condition is true.  Ex:- If i=0 Then msgbox "Hello" i=i+1 End If
  • 16. If-Else Condition Execute a block of statement when condition is true, otherwise execute another block of statements when condition false. If i=2 then msgbox”Hello world” Else Msgbox”Thank You” End if
  • 17. If-Elseif Condition (cont.)  Decide among several alternates.  if payment="Cash" then  msgbox "You are going to pay cash!"  elseif payment="Visa" then  msgbox "You are going to pay with visa."  elseif payment="AmEx" then  msgbox "You are going to pay with American Express." else  msgbox "Unknown method of payment.“  end If
  • 18. Select Case Condition  Using this statement one of several groups of statements are executed based on the expression value. Example: You can use the SELECT statement if you want to select one of many blocks of code to execute. Select case payment Case " Cash " msgbox " You are going to pay cash " Case " Visa " msgbox " You are going to pay with Visa " Case " AmEx" msgbox " You are going to pay with American Express" Case Else msgbox " Unknown method of payment" End Select
  • 19. For Loop A For loop is used for situations when you need to do something over and over again until some condition statement fails. Ex:- For count=0 to 3 Print (count) Next
  • 20. For Each Loop  It is useful when you want to go through every element in an array but you do not know how many elements are there inside the array.  Ex:- Dim a(2) a(0)= " Pen " a(1) =" Register" a(2)= " Copy" For Each item In a Print(item) Next
  • 21. Do-while loop  Do-while keywords are used to execute specified code for a set of times (until a condition remains true or a condition becomes false).  Syntax Do While <Condition for loop> Some Statements Loop
  • 22. Do-while loop (cont.)  Do-While can also used in following syntax: Do some Statements Loop While i>10
  • 23. Do-Until Loop  Do – Until keyword is used for repeating some set of statements until a certain condition is true.  Syntax: Do Until <Condition> some statmemts Loop
  • 24. Do-Until Loop (cont.)  Do-Until can also used in following syntax: Do some statements Loop Until <Condition>
  • 25. Built in Functions  VB Script provides several built in functions that can be used just by calling them.  Few Examples:  Date  Time  Int

Editor's Notes

  1. A variable is a &quot;container&quot; for information you want to store. A variable&apos;s value can change during the script. You can refer to a variable by name to see its value or to change its value. In VBScript, all variables are of type variant, that can store different types of data. 
  2. Dim num1,num2,resultSub add() num1= 10 num2 = 20 result=num1 + num2 msgbox (&quot;The Result is:&quot; &amp; result)End SubCall add()
  3. &apos; *********************Creating a Function without Arguments**********************************Function addition() Dim val1,val2,result val1=50 val2=50 result=val1+val2 addition=result End Functionmsgbox(&quot;The Result is:&quot; &amp;addition)
  4. **********************Code for simple If condition*******************Dim user_inputuser_input = inputbox(&quot;Enter any value less than 10 to execute If statement code &quot;)If user_input &lt; 10 Thenmsgbox(&quot;Code in if statement is executed......!&quot;)End If