SlideShare a Scribd company logo
1 of 3
Download to read offline
VBScript Procedures



In VBScript, there are two types of procedures:

       Sub procedure
       Function procedure



A Sub procedure:

       is a series of statements, enclosed by the Sub and End Sub statements
       does not return a value
       can take arguments
       without arguments, it must include an empty set of parentheses ()

eg.
Sub displayName()
 msgbox("QualityPoint Technologies")
End Sub

or

Sub addvalues(value1,value2)
 msgbox(value1+value2)
End Sub

When calling a Sub procedure you can use the Call statement, like this:

Call MyProc(argument)

Or, you can omit the Call statement, like this:

MyProc argument

A Function procedure:

       is a series of statements, enclosed by the Function and End Function statements
       can return a value
       can take arguments
       without arguments, must include an empty set of parentheses ()
       returns a value by assigning a value to its name
Find below a Sample function.

Function addvalues(value1,value2)
  addvalues=value1+value2
End Function

The above function will take take two arguments and will add those two values and then it will
return the sum value. Note here the sum value is retured by assigning it to the function name.

The above function can be called as below.

msgbox "Sum value is " & addvalues(1,2)

Conditional Statements



In VBScript we have four conditional statements:

if statement - executes a set of code when a condition is true

(e.g) if i=10 then
       msgbox "I am 10"
       End if
if...then...else statement - select one of two sets of lines to execute
(e.g) if i=10 then msgbox "I am 10"
     else msgbox "other than 10"
     end if

  if...then...elseif statement - select one of many sets of lines to execute
     (e.g) if i=10 then msgbox "I am 10"
    elseif i=11 then msgbox "I am 11"
    else msgbox "unknown"
    end if
  select case statement - select one of many sets of lines to execute
  select case value
 case 1
  msgbox "1"
 case 2
  msgbox "2"
 case 3
  msgbox "3"
 case else
  msgbox "other than 1,2 and 3"
end select
Looping Statements

Use the For...Next statement to run a block of code a specified number of times.
e.g
for i = 0 to 5
 msgbox("The number is " & i )
next

If you don't know how many repetitions you want, use a Do...Loop statement.

The Do...Loop statement repeats a block of code while a condition is true, or until a condition
becomes true.

Built-in Functions

VBscript is having many useful built-in functions.
You can refer this page for the complete list
inStr, isNull, LCase, Left, Len, Mid, Now, Replace, Split, UBound, CStr, CreateObject, Date and
DatePart are functions that are most frequently used in QTP script development.

More Related Content

What's hot

Intorudction into VBScript
Intorudction into VBScriptIntorudction into VBScript
Intorudction into VBScriptVitaliy Ganzha
 
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
 
Javascript conditional statements
Javascript conditional statementsJavascript conditional statements
Javascript conditional statementsnobel mujuji
 
Conditional statements in vb script
Conditional statements in vb scriptConditional statements in vb script
Conditional statements in vb scriptNilanjan Saha
 
Operators used in vb.net
Operators used in vb.netOperators used in vb.net
Operators used in vb.netJaya Kumari
 
Looping statements
Looping statementsLooping statements
Looping statementsJaya Kumari
 
Introduction to TypeScript
Introduction to TypeScriptIntroduction to TypeScript
Introduction to TypeScriptKeithMurgic
 
Javascript conditional statements 1
Javascript conditional statements 1Javascript conditional statements 1
Javascript conditional statements 1Jesus Obenita Jr.
 
JavaScript Loop: Optimization of Weak Typing
JavaScript Loop: Optimization of Weak TypingJavaScript Loop: Optimization of Weak Typing
JavaScript Loop: Optimization of Weak TypingJanlay Wu
 
Javascripts hidden treasures BY - https://geekyants.com/
Javascripts hidden treasures            BY  -  https://geekyants.com/Javascripts hidden treasures            BY  -  https://geekyants.com/
Javascripts hidden treasures BY - https://geekyants.com/Geekyants
 

What's hot (20)

Intorudction into VBScript
Intorudction into VBScriptIntorudction into VBScript
Intorudction into VBScript
 
Vbs
VbsVbs
Vbs
 
Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]Vb script tutorial for qtp[1]
Vb script tutorial for qtp[1]
 
Vb script
Vb scriptVb script
Vb script
 
Javascript conditional statements
Javascript conditional statementsJavascript conditional statements
Javascript conditional statements
 
Conditional statements in vb script
Conditional statements in vb scriptConditional statements in vb script
Conditional statements in vb script
 
Conditional statements
Conditional statementsConditional statements
Conditional statements
 
Vb script tutorial
Vb script tutorialVb script tutorial
Vb script tutorial
 
Operators used in vb.net
Operators used in vb.netOperators used in vb.net
Operators used in vb.net
 
Vb script tutorial
Vb script tutorialVb script tutorial
Vb script tutorial
 
Looping statements
Looping statementsLooping statements
Looping statements
 
TypeScript, Now.
TypeScript, Now.TypeScript, Now.
TypeScript, Now.
 
Loops in java script
Loops in java scriptLoops in java script
Loops in java script
 
Introduction to TypeScript
Introduction to TypeScriptIntroduction to TypeScript
Introduction to TypeScript
 
Javascript conditional statements 1
Javascript conditional statements 1Javascript conditional statements 1
Javascript conditional statements 1
 
JavaScript Loop: Optimization of Weak Typing
JavaScript Loop: Optimization of Weak TypingJavaScript Loop: Optimization of Weak Typing
JavaScript Loop: Optimization of Weak Typing
 
Switch case and looping jam
Switch case and looping jamSwitch case and looping jam
Switch case and looping jam
 
C# Loops
C# LoopsC# Loops
C# Loops
 
Javascripts hidden treasures BY - https://geekyants.com/
Javascripts hidden treasures            BY  -  https://geekyants.com/Javascripts hidden treasures            BY  -  https://geekyants.com/
Javascripts hidden treasures BY - https://geekyants.com/
 
Program control statements in c#
Program control statements in c#Program control statements in c#
Program control statements in c#
 

Viewers also liked

Vb script reference
Vb script referenceVb script reference
Vb script referencePeterSayer
 
Coding standards
Coding standardsCoding standards
Coding standardsMimoh Ojha
 
VBScript Tutorial
VBScript TutorialVBScript Tutorial
VBScript TutorialLeminy
 
Журнал "Инфогород". Выпуск 7
Журнал "Инфогород". Выпуск 7Журнал "Инфогород". Выпуск 7
Журнал "Инфогород". Выпуск 7Moscow IT Department
 
Информационный город 2013: итоги
Информационный город 2013: итогиИнформационный город 2013: итоги
Информационный город 2013: итогиMoscow IT Department
 
узнай москву презентация
узнай москву презентацияузнай москву презентация
узнай москву презентацияMoscow IT Department
 
Notice of the 83rd AGM of Poona Club Limited
Notice of the 83rd AGM of Poona Club LimitedNotice of the 83rd AGM of Poona Club Limited
Notice of the 83rd AGM of Poona Club LimitedRanjan Rajgopaul
 
Итоги радиомониторинга качества связи в Москве, июнь 2012 г.
Итоги радиомониторинга качества связи в Москве, июнь 2012 г.Итоги радиомониторинга качества связи в Москве, июнь 2012 г.
Итоги радиомониторинга качества связи в Москве, июнь 2012 г.Moscow IT Department
 
Журнал "Инфогород". Выпуск 1
Журнал "Инфогород". Выпуск 1Журнал "Инфогород". Выпуск 1
Журнал "Инфогород". Выпуск 1Moscow IT Department
 
Открытые данные: от теории к практике
Открытые данные: от теории к практикеОткрытые данные: от теории к практике
Открытые данные: от теории к практикеMoscow IT Department
 
Видеонаблюдение на выборах в Мосгордуму
Видеонаблюдение на выборах в МосгордумуВидеонаблюдение на выборах в Мосгордуму
Видеонаблюдение на выборах в МосгордумуMoscow IT Department
 
Бюллетень "Инфошкола". Выпуск 14
Бюллетень "Инфошкола". Выпуск 14Бюллетень "Инфошкола". Выпуск 14
Бюллетень "Инфошкола". Выпуск 14Moscow IT Department
 
Virtual Worlds in Education Velon 15.03.2011
Virtual Worlds in Education Velon 15.03.2011Virtual Worlds in Education Velon 15.03.2011
Virtual Worlds in Education Velon 15.03.2011licto07
 
Журнал "Инфогород". Выпуск 5
Журнал "Инфогород". Выпуск 5Журнал "Инфогород". Выпуск 5
Журнал "Инфогород". Выпуск 5Moscow IT Department
 
Активный гражданин. Итоги первой недели
Активный гражданин. Итоги первой неделиАктивный гражданин. Итоги первой недели
Активный гражданин. Итоги первой неделиMoscow IT Department
 
Agile (mal)Practices Considered Harmful
Agile (mal)Practices Considered HarmfulAgile (mal)Practices Considered Harmful
Agile (mal)Practices Considered Harmful⇥ Tung Lam Vu ⇤
 
Мониторинг покупательской способности москвичей в сфере ИКТ
Мониторинг покупательской способности москвичей в сфере ИКТМониторинг покупательской способности москвичей в сфере ИКТ
Мониторинг покупательской способности москвичей в сфере ИКТMoscow IT Department
 

Viewers also liked (20)

Vb script
Vb scriptVb script
Vb script
 
Vb script reference
Vb script referenceVb script reference
Vb script reference
 
Coding standards
Coding standardsCoding standards
Coding standards
 
VBScript Tutorial
VBScript TutorialVBScript Tutorial
VBScript Tutorial
 
Журнал "Инфогород". Выпуск 7
Журнал "Инфогород". Выпуск 7Журнал "Инфогород". Выпуск 7
Журнал "Инфогород". Выпуск 7
 
Информационный город 2013: итоги
Информационный город 2013: итогиИнформационный город 2013: итоги
Информационный город 2013: итоги
 
узнай москву презентация
узнай москву презентацияузнай москву презентация
узнай москву презентация
 
Notice of the 83rd AGM of Poona Club Limited
Notice of the 83rd AGM of Poona Club LimitedNotice of the 83rd AGM of Poona Club Limited
Notice of the 83rd AGM of Poona Club Limited
 
Итоги радиомониторинга качества связи в Москве, июнь 2012 г.
Итоги радиомониторинга качества связи в Москве, июнь 2012 г.Итоги радиомониторинга качества связи в Москве, июнь 2012 г.
Итоги радиомониторинга качества связи в Москве, июнь 2012 г.
 
Журнал "Инфогород". Выпуск 1
Журнал "Инфогород". Выпуск 1Журнал "Инфогород". Выпуск 1
Журнал "Инфогород". Выпуск 1
 
Открытые данные: от теории к практике
Открытые данные: от теории к практикеОткрытые данные: от теории к практике
Открытые данные: от теории к практике
 
Инфошкола #1
Инфошкола #1Инфошкола #1
Инфошкола #1
 
Видеонаблюдение на выборах в Мосгордуму
Видеонаблюдение на выборах в МосгордумуВидеонаблюдение на выборах в Мосгордуму
Видеонаблюдение на выборах в Мосгордуму
 
Sxsw in tweets 2008
Sxsw in tweets 2008Sxsw in tweets 2008
Sxsw in tweets 2008
 
Бюллетень "Инфошкола". Выпуск 14
Бюллетень "Инфошкола". Выпуск 14Бюллетень "Инфошкола". Выпуск 14
Бюллетень "Инфошкола". Выпуск 14
 
Virtual Worlds in Education Velon 15.03.2011
Virtual Worlds in Education Velon 15.03.2011Virtual Worlds in Education Velon 15.03.2011
Virtual Worlds in Education Velon 15.03.2011
 
Журнал "Инфогород". Выпуск 5
Журнал "Инфогород". Выпуск 5Журнал "Инфогород". Выпуск 5
Журнал "Инфогород". Выпуск 5
 
Активный гражданин. Итоги первой недели
Активный гражданин. Итоги первой неделиАктивный гражданин. Итоги первой недели
Активный гражданин. Итоги первой недели
 
Agile (mal)Practices Considered Harmful
Agile (mal)Practices Considered HarmfulAgile (mal)Practices Considered Harmful
Agile (mal)Practices Considered Harmful
 
Мониторинг покупательской способности москвичей в сфере ИКТ
Мониторинг покупательской способности москвичей в сфере ИКТМониторинг покупательской способности москвичей в сфере ИКТ
Мониторинг покупательской способности москвичей в сфере ИКТ
 

Similar to Vbscript

The Ring programming language version 1.5.2 book - Part 175 of 181
The Ring programming language version 1.5.2 book - Part 175 of 181The Ring programming language version 1.5.2 book - Part 175 of 181
The Ring programming language version 1.5.2 book - Part 175 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.4 book - Part 29 of 30
The Ring programming language version 1.4 book - Part 29 of 30The Ring programming language version 1.4 book - Part 29 of 30
The Ring programming language version 1.4 book - Part 29 of 30Mahmoud Samir Fayed
 
Introduction to python programming ( part-2 )
Introduction to python programming ( part-2 )Introduction to python programming ( part-2 )
Introduction to python programming ( part-2 )Ziyauddin Shaik
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013amanabr
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Kurmendra Singh
 
The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 19 of 180
The Ring programming language version 1.5.1 book - Part 19 of 180The Ring programming language version 1.5.1 book - Part 19 of 180
The Ring programming language version 1.5.1 book - Part 19 of 180Mahmoud Samir Fayed
 
Python programing
Python programingPython programing
Python programinghamzagame
 
The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.4 book - Part 5 of 30
The Ring programming language version 1.4 book - Part 5 of 30The Ring programming language version 1.4 book - Part 5 of 30
The Ring programming language version 1.4 book - Part 5 of 30Mahmoud Samir Fayed
 
ForLoopandUserDefinedFunctions.pptx
ForLoopandUserDefinedFunctions.pptxForLoopandUserDefinedFunctions.pptx
ForLoopandUserDefinedFunctions.pptxAaliyanShaikh
 
C++ control structure
C++ control structureC++ control structure
C++ control structurebluejayjunior
 
The Ring programming language version 1.5.4 book - Part 179 of 185
The Ring programming language version 1.5.4 book - Part 179 of 185The Ring programming language version 1.5.4 book - Part 179 of 185
The Ring programming language version 1.5.4 book - Part 179 of 185Mahmoud Samir Fayed
 
Error and exception in python
Error and exception in pythonError and exception in python
Error and exception in pythonjunnubabu
 

Similar to Vbscript (20)

Vb.net ii
Vb.net iiVb.net ii
Vb.net ii
 
The Ring programming language version 1.5.2 book - Part 175 of 181
The Ring programming language version 1.5.2 book - Part 175 of 181The Ring programming language version 1.5.2 book - Part 175 of 181
The Ring programming language version 1.5.2 book - Part 175 of 181
 
The Ring programming language version 1.4 book - Part 29 of 30
The Ring programming language version 1.4 book - Part 29 of 30The Ring programming language version 1.4 book - Part 29 of 30
The Ring programming language version 1.4 book - Part 29 of 30
 
Javascript
JavascriptJavascript
Javascript
 
Introduction to python programming ( part-2 )
Introduction to python programming ( part-2 )Introduction to python programming ( part-2 )
Introduction to python programming ( part-2 )
 
03 function overloading
03 function overloading03 function overloading
03 function overloading
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 
Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013Dsp lab _eec-652__vi_sem_18012013
Dsp lab _eec-652__vi_sem_18012013
 
Ruby Basics
Ruby BasicsRuby Basics
Ruby Basics
 
The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84The Ring programming language version 1.2 book - Part 11 of 84
The Ring programming language version 1.2 book - Part 11 of 84
 
The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212The Ring programming language version 1.10 book - Part 101 of 212
The Ring programming language version 1.10 book - Part 101 of 212
 
The Ring programming language version 1.5.1 book - Part 19 of 180
The Ring programming language version 1.5.1 book - Part 19 of 180The Ring programming language version 1.5.1 book - Part 19 of 180
The Ring programming language version 1.5.1 book - Part 19 of 180
 
Python programing
Python programingPython programing
Python programing
 
The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88The Ring programming language version 1.3 book - Part 13 of 88
The Ring programming language version 1.3 book - Part 13 of 88
 
The Ring programming language version 1.4 book - Part 5 of 30
The Ring programming language version 1.4 book - Part 5 of 30The Ring programming language version 1.4 book - Part 5 of 30
The Ring programming language version 1.4 book - Part 5 of 30
 
ForLoopandUserDefinedFunctions.pptx
ForLoopandUserDefinedFunctions.pptxForLoopandUserDefinedFunctions.pptx
ForLoopandUserDefinedFunctions.pptx
 
C++ control structure
C++ control structureC++ control structure
C++ control structure
 
The Ring programming language version 1.5.4 book - Part 179 of 185
The Ring programming language version 1.5.4 book - Part 179 of 185The Ring programming language version 1.5.4 book - Part 179 of 185
The Ring programming language version 1.5.4 book - Part 179 of 185
 
Error and exception in python
Error and exception in pythonError and exception in python
Error and exception in python
 
Namespaces
NamespacesNamespaces
Namespaces
 

Recently uploaded

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 

Vbscript

  • 1. VBScript Procedures In VBScript, there are two types of procedures: Sub procedure Function procedure A Sub procedure: is a series of statements, enclosed by the Sub and End Sub statements does not return a value can take arguments without arguments, it must include an empty set of parentheses () eg. Sub displayName() msgbox("QualityPoint Technologies") End Sub or Sub addvalues(value1,value2) msgbox(value1+value2) End Sub When calling a Sub procedure you can use the Call statement, like this: Call MyProc(argument) Or, you can omit the Call statement, like this: MyProc argument A Function procedure: is a series of statements, enclosed by the Function and End Function statements can return a value can take arguments without arguments, must include an empty set of parentheses () returns a value by assigning a value to its name
  • 2. Find below a Sample function. Function addvalues(value1,value2) addvalues=value1+value2 End Function The above function will take take two arguments and will add those two values and then it will return the sum value. Note here the sum value is retured by assigning it to the function name. The above function can be called as below. msgbox "Sum value is " & addvalues(1,2) Conditional Statements In VBScript we have four conditional statements: if statement - executes a set of code when a condition is true (e.g) if i=10 then msgbox "I am 10" End if if...then...else statement - select one of two sets of lines to execute (e.g) if i=10 then msgbox "I am 10" else msgbox "other than 10" end if if...then...elseif statement - select one of many sets of lines to execute (e.g) if i=10 then msgbox "I am 10" elseif i=11 then msgbox "I am 11" else msgbox "unknown" end if select case statement - select one of many sets of lines to execute select case value case 1 msgbox "1" case 2 msgbox "2" case 3 msgbox "3" case else msgbox "other than 1,2 and 3" end select
  • 3. Looping Statements Use the For...Next statement to run a block of code a specified number of times. e.g for i = 0 to 5 msgbox("The number is " & i ) next If you don't know how many repetitions you want, use a Do...Loop statement. The Do...Loop statement repeats a block of code while a condition is true, or until a condition becomes true. Built-in Functions VBscript is having many useful built-in functions. You can refer this page for the complete list inStr, isNull, LCase, Left, Len, Mid, Now, Replace, Split, UBound, CStr, CreateObject, Date and DatePart are functions that are most frequently used in QTP script development.