powerpoint vbscript and how to use visual basic in powerpoint and scripting language ppt
SVB Scripting Basics
VBScript stands for Visual Basic Scripting, is a
scripting language was launched by Microsoft in1996.
VB Scripting language is a lightweight programming
VBScript can be used to write both client-side and
VBScript is a light version of Microsoft's
programming language Visual Basic
VBScript is only supported by Microsoft's browsers
(Internet Explorer)Data Types
VBScript supports only one data type called ‘Variant’.
The variant data type is a special kind of data type
that can contain different kinds of information.
It is the default data type returned by all functions in
A variant behaves as a number when it is used in a
numeric context and as a string when used in a string
SVB Script Variables
A variable is a "container" /Placeholder that refers
to a memory location, that stores program
information that may change at run time.
As with algebra, VBScript variables are used to hold
values or expressions.
A variable can have a short name, like x, or a more
descriptive name, like carname.
SRules for VBScript variable names
Must begin with a letter
Cannot contain a period (.)
Cannot exceed 255 characters
In VB Script, all variables are variant data type, that can
store different types of data.
SDeclaring (Creating) VBScript
Creating variables in VBScript is most often
referred to as "declaring" variables.
You can declare VBScript variables with the
Dim, Public or the Private statement. Like this:
- Dim x
- Dim carname
SVB Script Array Variables
An array variable is used to store multiple values in a single
In the following example, an array containing 3 elements is
Ex: Dim names(2)
The number shown in the parentheses is 2. We start at zero
so this array contains 3 elements. This is a fixed-size array.
You assign data to each of the elements of the array like
SVB Script Procedures
VB Script has two kinds procedures:
1.) Sub procedure
2.) Function procedure
1.) Sub procedure:
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.
Is a series of statements, enclosed
by the Function and End Function
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
Returns a value by assigning
a value to its name.Conditional Statements
Conditional statements are used to perform different actions
for different decisions.
In VBScript we have four conditional statements:
If statement - executes a set of code when a condition is true
If...Then...Else statement - select one of two sets of lines to
If...Then...ElseIf statement - select one of many sets of lines
Select Case statement - select one of many sets of lines to
Use the If...Then...Else statement if you want to
Execute some code if a condition is true
Select one of two blocks of code to execute
If you want to execute only one statement when a condition is true,
you can write the code on one line:
Ex: Function greeting()
If i 10 Then
msgbox "Good morning"
msgbox "Have a nice day"
You can also use the "Select Case" statement if you want to select one
of many blocks of code to execute:
Select Case d
msgbox "Sleepy Sunday"
End SelectVB Script Operators
Operators are used to "do operations" or manipulate
variables and values.
For example, addition is an example of a
mathematical operator and concatenation is an
example of a string operator.
The plus sign "+" is the operator used in
programming language to represent this
mathematical addition operation.
When you want to perform addition,
subtraction, multiplication, and
other mathematical operations on
numbers and variables use the
operators listed below.
SCom Comp pa ar ris iso on n O Ope per ra ato tor rss
When you want to compare two numbers to see
which is bigger, if they're equal, or some other
type of relationship use the comparison operators
Common uses of comparison operators are within
conditional statements like an If Statement or the
condition check in a While Loop.
Logic operators are used to
manipulate and create logical
statements. For example if
you wanted a variable
shoeSize to be equal to 10 or
11 then you would do
SString Concatenation Operator
When you have
various strings that
you would like to
combine into one string
use the concatenation
You can find us at queriesthesisscientist.com