VBScript Tutorial 4:
(VBScript Conditional together with Loop Statements)
I) VBScript Conditional Statements
i) Execute a Statement when status is True.
Syntax:
If Condition Then Statement
Example:
Dim myDate
myDate = #10/10/2010#
If myDate < Date Then myDate = Date
Msgbox myDate
myDate = #10/10/2017#
If myDate < Date Then myDate = Date
Msgbox myDate
------------------------------------------------
ii) Execute a Block of statements when status is True.
Syntax:
If Condition Then
Statements
------------
-----------
------------
End If
Example:
Dim a, b
a = 100
b = 900
If a > b Then
Msgbox "A is a Big Number"
End If
--------------------------------------
iii) Execute a Block of statements when status is True, otherwise execute to a greater extent than or less other block of statements.
Syntax:
If Condition Then
Statements
-----------
-----------
-----------
Else
Statements
-----------
-----------
-----------
End If
Examples:
-----------
Dim a, b
a = 100
b = 900
If a > b Then
Msgbox "A is a Big Number"
Else
Msgbox "B is a Big Number"
End If
------------------
Dim a, b
a = InputBox("Enter Influenza A virus subtype H5N1 Value")
b = InputBox("Enter B Value")
If Cint (a) > Cint (b) Then
Msgbox "A is a Big Number"
Else
Msgbox "B is a Big Number"
End If
-------------------------------
Dim a, b
a = InputBox("Enter Influenza A virus subtype H5N1 Value")
b = InputBox("Enter B Value")
If ISNumeric(a) = True And IsNumeric(b) = True Then
If Cint (a) > Cint (b) Then
Msgbox "A is a Big Number"
Else
Msgbox "B is a Big Number"
End If
Else
Msgbox "Invalid Input"
End If
-------------------------------------------------
iv) Decide amid several alternates (Else If)
Syntax:
If Condition then
Statements
-------------
------------
----------
ElseIf Condition Then
Statements
-------------
------------
----------
ElseIf Condition Then
Statements
-------------
------------
----------
ElseIf Condition Then
Statements
-------------
------------
----------
Else
Statements
-------------
------------
----------
End If
------------------------------
Example:
'Read a Value together with Verify the Range
'If the value is inwards betwixt 1 together with 100 together with hence display "Value is a Small Number"
'If the value is inwards betwixt 101 together with one one thousand together with hence display "Value is a Medium Number"
'If the value is inwards betwixt 1001 together with 10000 together with hence display "Value is a Big Number"
'If the value is to a greater extent than than 10000 together with hence display "Value is High Number"
'Otherwise display "value is either Zero or Negative value.
'---------------------------------------------------------------------
Dim val
val = InputBox("Enter a Value")
If IsNumeric(val) Then
If val >= 1 And val <=100 Then
Msgbox "Value is Small Number"
ElseIf val > 100 And val <= one one thousand Then
Msgbox "Value is a Medium Number"
ElseIf val > one one thousand And val <= 10000 Then
Msgbox "Value is a Big Number"
ElseIf val > 10000 Then
Msgbox "Value is High Number"
Else
Msgbox "value is either Zero or Negative Value"
End If
Else
msgbox "Invalid Input"
End If
-----------------------------
v) Execute a block of statements when to a greater extent than than i status is True
Syntax:
If Condition Then
If Condition Then
If Condition Then
Statements
---------
-----------
Else
----------
---------
End If
End If
End If
------------------------------------
Example:
'Read a Value together with verify whether the Value is Valid Mobile Number or not?
'Value should move Numeric
'Value must incorporate 10 digits
'First alphabetic lineament should move either ix or 8
'-----------------------------------------------
Dim val
val = InputBox ("Enter a Value")
If IsNumeric(val) = True Then
If Len(val) = 10 Then
If Left(val, 1) = ix Or Left(val, 1) = 8 Then
Msgbox "val is a Valid Mobile Number"
Else
Msgbox "Val is Invalid Mobile Number"
End If
Else
Msgbox "It is non a 10 digit value"
End If
Else
Msgbox "It is non a Numeric Value"
End If
--------------------------------
'Handle . Symbol
----------------------------------------------
vi) Decide amid several alternates (using Select Case)
Syntax:
Select Case TestExpression
Case "Case1Name"
Statements
----------
----------
Case "Case2Name"
Statements
----------
----------
Case "Case3Name"
Statements
----------
----------
Case Else
Statements
----------
--------
----------
End select
------------------------------------
Example:
Dim a, b, operation
a = 10
b = 20
operation = LCase (InputBox("Enter a value"))
Select Case operation
Case "add"
Msgbox "Addition of a, b is: "& a+b
Case "sub"
Msgbox "Subtraction of a, b is: "& a-b
Case "mul"
Msgbox "Multiplication of a, b is: "& a*b
Case "div"
Msgbox "Division of a, b is: "& a/b
Case Else
msgbox "Invalid Operation"
End Select
------------------------------------------
II) VBScript Loop Statements
a) For...Next
b) While...Wend
c) Do While / Until...Loop
d) For Each...Next
-----------------------------------------------
i) For...Next
Description:
It repeats a block of statements for a specified reveal of times.
Syntax:
For Counter (Variable) = Start to End Step Incr/Decr
Statements
---------
----------
-----------
Next
Example:
For i = 1 To v Step 1
Msgbox i & " Hello UFT"
Next
----------------------------------------------
For OrderNumber = 1 To 10 Step 1
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNumber
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Next
-------------------------------
' Terminating For loop
For OrderNumber = twenty To 25 Step 1
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNumber
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
If Window("Flight Reservation").Dialog("Open Order").Dialog("Flight Reservations").Exist(3) Then
Window("Flight Reservation").Dialog("Open Order").Dialog("Flight Reservations").WinButton("OK").Click
Window("Flight Reservation").Dialog("Open Order").WinButton("Cancel").Click
Window("Flight Reservation").WinButton("Button_2").Click
Reporter.ReportEvent 3, "Res", "Up to "& OrderNumber -1 & " Orders exclusively Exist"
Exit For
End If
Next
------------------------------------------------
ii) While...Wend
It repeats a block of statements piece status is True
Syntax:
While Condition
Statements
----------
----------
---------
Incr/Decr
Wend
-----------------------------------
Example:
OrderNo = 1
While OrderNo <= 5
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNo
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
OrderNo = OrderNo + 1
Wend
----------------------------------
iii) Do While / Until...Loop
Using While Keyword
It repeats a block of statements piece status is True
Using Until Keyword
It repeats a block of statements Until status is True
-----------------------------------------
i)
Do While Condition
Statements
----------
----------
Incr/Decr
Loop
ii)
Do
Statements
----------
----------
Incr/Decr
Loop While Condition
---------------------------------
iii)
Do Until Condition
Statements
-----------
------------
----------
Incr/Decr
Loop
iv)
Do
Statements
-----------
------------
----------
Incr/Decr
Loop Until Condition
---------------------------------------
Examples:
OrderNo = 1
Do While OrderNo <= 5
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNo
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
OrderNo = OrderNo + 1
Loop
--------------------------------------------
OrderNo = 10
Do
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNo
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
OrderNo = OrderNo + 1
Loop While OrderNo <= 5
--------------------------------
OrderNo = 1
Do Until OrderNo > 5
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNo
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
OrderNo = OrderNo + 1
Loop
--------------------------------
OrderNo = 1
Do
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNo
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
OrderNo = OrderNo + 1
Loop Until OrderNo > 5
---------------------------------------
'Terminating Do loop
OrderNo = 20
Do Until OrderNo > 30
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNo
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
If Window("Flight Reservation").Dialog("Open Order").Dialog("Flight Reservations").Exist(3) Then
Window("Flight Reservation").Dialog("Open Order").Dialog("Flight Reservations").WinButton("OK").Click
Window("Flight Reservation").Dialog("Open Order").WinButton("Cancel").Click
Window("Flight Reservation").WinButton("Button_2").Click
Reporter.ReportEvent micWarning, "Res", "Up to "& OrderNo-1 & " Orders exclusively exist"
Exit Do
End If
OrderNo = OrderNo + 1
Loop
-------------------------------------
iv) For Each...Next
It executes all elements inwards an Array.
Syntax:
For Each Element inwards Array
Statements
----------
----------
Next
-----------------------------
Example:
Dim a, b, res(3)
a = 10
b = 20
res(0) = "Addition of a, b is: "& a + b
res(1) = "Subtraction of a, b is: "& a - b
res(2) = "Multiplication of a, b is: "& a * b
res(3) = "Division of a, b is: "& a / b
For Each Element inwards res
Msgbox Element
Next
-------------------------------------------------
III VBScript Functions
> What is Function?
A reusable code.
> When nosotros lead Functions?
Whenever nosotros desire to perform same functioning multiple times together with hence nosotros lead Functions.
> Two types of Functions
i) Built inwards Functions
Array functions
String functions
I/O Functions
Date & Time Functions
Conversion functions etc....
ii) User defined Functions
a) Sub Procedures
b) Function Procedures
--------------------------------
User defined Functions
a) Sub Procedures
Set of statements enclosed alongside Sub together with End sub statements to perform an operation.
Sub Procedure takes Arguments, simply Arguments are optional.
Sub Procedure won't provide whatever value.
Syntax:
-----------
Sub procedureName (Argumnets)
Statements
-----------
---------
---------
End Sub
----------------------------------------------------
b) Function Procedures
Set of statements enclosed alongside Function together with End Function statements to perform an Operation.
Function Procedure takes Arguments, simply Arguments are optional
Function Procedure Can provide a value.
Syntax:
Function procedureName (Arguments)
Statements
-----------
-------------
------------
End Function
Note: Sub procedures are faster inwards Execution than Function Procedures.
--------------------------------------------------------------
Access Modifiers
Public
Private
-----------------
Usage of Functions
Internal - Defining together with calling inside the script
External - Calling from external library files.
-------------------------------------------------
Sumber http://www.gcreddy.com/
(VBScript Conditional together with Loop Statements)
I) VBScript Conditional Statements
i) Execute a Statement when status is True.
Syntax:
If Condition Then Statement
Example:
Dim myDate
myDate = #10/10/2010#
If myDate < Date Then myDate = Date
Msgbox myDate
myDate = #10/10/2017#
If myDate < Date Then myDate = Date
Msgbox myDate
------------------------------------------------
ii) Execute a Block of statements when status is True.
Syntax:
If Condition Then
Statements
------------
-----------
------------
End If
Example:
Dim a, b
a = 100
b = 900
If a > b Then
Msgbox "A is a Big Number"
End If
--------------------------------------
iii) Execute a Block of statements when status is True, otherwise execute to a greater extent than or less other block of statements.
Syntax:
If Condition Then
Statements
-----------
-----------
-----------
Else
Statements
-----------
-----------
-----------
End If
Examples:
-----------
Dim a, b
a = 100
b = 900
If a > b Then
Msgbox "A is a Big Number"
Else
Msgbox "B is a Big Number"
End If
------------------
Dim a, b
a = InputBox("Enter Influenza A virus subtype H5N1 Value")
b = InputBox("Enter B Value")
If Cint (a) > Cint (b) Then
Msgbox "A is a Big Number"
Else
Msgbox "B is a Big Number"
End If
-------------------------------
Dim a, b
a = InputBox("Enter Influenza A virus subtype H5N1 Value")
b = InputBox("Enter B Value")
If ISNumeric(a) = True And IsNumeric(b) = True Then
If Cint (a) > Cint (b) Then
Msgbox "A is a Big Number"
Else
Msgbox "B is a Big Number"
End If
Else
Msgbox "Invalid Input"
End If
-------------------------------------------------
iv) Decide amid several alternates (Else If)
Syntax:
If Condition then
Statements
-------------
------------
----------
ElseIf Condition Then
Statements
-------------
------------
----------
ElseIf Condition Then
Statements
-------------
------------
----------
ElseIf Condition Then
Statements
-------------
------------
----------
Else
Statements
-------------
------------
----------
End If
------------------------------
Example:
'Read a Value together with Verify the Range
'If the value is inwards betwixt 1 together with 100 together with hence display "Value is a Small Number"
'If the value is inwards betwixt 101 together with one one thousand together with hence display "Value is a Medium Number"
'If the value is inwards betwixt 1001 together with 10000 together with hence display "Value is a Big Number"
'If the value is to a greater extent than than 10000 together with hence display "Value is High Number"
'Otherwise display "value is either Zero or Negative value.
'---------------------------------------------------------------------
Dim val
val = InputBox("Enter a Value")
If IsNumeric(val) Then
If val >= 1 And val <=100 Then
Msgbox "Value is Small Number"
ElseIf val > 100 And val <= one one thousand Then
Msgbox "Value is a Medium Number"
ElseIf val > one one thousand And val <= 10000 Then
Msgbox "Value is a Big Number"
ElseIf val > 10000 Then
Msgbox "Value is High Number"
Else
Msgbox "value is either Zero or Negative Value"
End If
Else
msgbox "Invalid Input"
End If
-----------------------------
v) Execute a block of statements when to a greater extent than than i status is True
Syntax:
If Condition Then
If Condition Then
If Condition Then
Statements
---------
-----------
Else
----------
---------
End If
End If
End If
------------------------------------
Example:
'Read a Value together with verify whether the Value is Valid Mobile Number or not?
'Value should move Numeric
'Value must incorporate 10 digits
'First alphabetic lineament should move either ix or 8
'-----------------------------------------------
Dim val
val = InputBox ("Enter a Value")
If IsNumeric(val) = True Then
If Len(val) = 10 Then
If Left(val, 1) = ix Or Left(val, 1) = 8 Then
Msgbox "val is a Valid Mobile Number"
Else
Msgbox "Val is Invalid Mobile Number"
End If
Else
Msgbox "It is non a 10 digit value"
End If
Else
Msgbox "It is non a Numeric Value"
End If
--------------------------------
'Handle . Symbol
----------------------------------------------
vi) Decide amid several alternates (using Select Case)
Syntax:
Select Case TestExpression
Case "Case1Name"
Statements
----------
----------
Case "Case2Name"
Statements
----------
----------
Case "Case3Name"
Statements
----------
----------
Case Else
Statements
----------
--------
----------
End select
------------------------------------
Example:
Dim a, b, operation
a = 10
b = 20
operation = LCase (InputBox("Enter a value"))
Select Case operation
Case "add"
Msgbox "Addition of a, b is: "& a+b
Case "sub"
Msgbox "Subtraction of a, b is: "& a-b
Case "mul"
Msgbox "Multiplication of a, b is: "& a*b
Case "div"
Msgbox "Division of a, b is: "& a/b
Case Else
msgbox "Invalid Operation"
End Select
------------------------------------------
II) VBScript Loop Statements
a) For...Next
b) While...Wend
c) Do While / Until...Loop
d) For Each...Next
-----------------------------------------------
i) For...Next
Description:
It repeats a block of statements for a specified reveal of times.
Syntax:
For Counter (Variable) = Start to End Step Incr/Decr
Statements
---------
----------
-----------
Next
Example:
For i = 1 To v Step 1
Msgbox i & " Hello UFT"
Next
----------------------------------------------
For OrderNumber = 1 To 10 Step 1
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNumber
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Next
-------------------------------
' Terminating For loop
For OrderNumber = twenty To 25 Step 1
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNumber
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
If Window("Flight Reservation").Dialog("Open Order").Dialog("Flight Reservations").Exist(3) Then
Window("Flight Reservation").Dialog("Open Order").Dialog("Flight Reservations").WinButton("OK").Click
Window("Flight Reservation").Dialog("Open Order").WinButton("Cancel").Click
Window("Flight Reservation").WinButton("Button_2").Click
Reporter.ReportEvent 3, "Res", "Up to "& OrderNumber -1 & " Orders exclusively Exist"
Exit For
End If
Next
------------------------------------------------
ii) While...Wend
It repeats a block of statements piece status is True
Syntax:
While Condition
Statements
----------
----------
---------
Incr/Decr
Wend
-----------------------------------
Example:
OrderNo = 1
While OrderNo <= 5
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNo
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
OrderNo = OrderNo + 1
Wend
----------------------------------
iii) Do While / Until...Loop
Using While Keyword
It repeats a block of statements piece status is True
Using Until Keyword
It repeats a block of statements Until status is True
-----------------------------------------
i)
Do While Condition
Statements
----------
----------
Incr/Decr
Loop
ii)
Do
Statements
----------
----------
Incr/Decr
Loop While Condition
---------------------------------
iii)
Do Until Condition
Statements
-----------
------------
----------
Incr/Decr
Loop
iv)
Do
Statements
-----------
------------
----------
Incr/Decr
Loop Until Condition
---------------------------------------
Examples:
OrderNo = 1
Do While OrderNo <= 5
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNo
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
OrderNo = OrderNo + 1
Loop
--------------------------------------------
OrderNo = 10
Do
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNo
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
OrderNo = OrderNo + 1
Loop While OrderNo <= 5
--------------------------------
OrderNo = 1
Do Until OrderNo > 5
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNo
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
OrderNo = OrderNo + 1
Loop
--------------------------------
OrderNo = 1
Do
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNo
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
OrderNo = OrderNo + 1
Loop Until OrderNo > 5
---------------------------------------
'Terminating Do loop
OrderNo = 20
Do Until OrderNo > 30
Window("Flight Reservation").Activate
Window("Flight Reservation").WinButton("Button").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set OrderNo
Wait 2
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
If Window("Flight Reservation").Dialog("Open Order").Dialog("Flight Reservations").Exist(3) Then
Window("Flight Reservation").Dialog("Open Order").Dialog("Flight Reservations").WinButton("OK").Click
Window("Flight Reservation").Dialog("Open Order").WinButton("Cancel").Click
Window("Flight Reservation").WinButton("Button_2").Click
Reporter.ReportEvent micWarning, "Res", "Up to "& OrderNo-1 & " Orders exclusively exist"
Exit Do
End If
OrderNo = OrderNo + 1
Loop
-------------------------------------
iv) For Each...Next
It executes all elements inwards an Array.
Syntax:
For Each Element inwards Array
Statements
----------
----------
Next
-----------------------------
Example:
Dim a, b, res(3)
a = 10
b = 20
res(0) = "Addition of a, b is: "& a + b
res(1) = "Subtraction of a, b is: "& a - b
res(2) = "Multiplication of a, b is: "& a * b
res(3) = "Division of a, b is: "& a / b
For Each Element inwards res
Msgbox Element
Next
-------------------------------------------------
III VBScript Functions
> What is Function?
A reusable code.
> When nosotros lead Functions?
Whenever nosotros desire to perform same functioning multiple times together with hence nosotros lead Functions.
> Two types of Functions
i) Built inwards Functions
Array functions
String functions
I/O Functions
Date & Time Functions
Conversion functions etc....
ii) User defined Functions
a) Sub Procedures
b) Function Procedures
--------------------------------
User defined Functions
a) Sub Procedures
Set of statements enclosed alongside Sub together with End sub statements to perform an operation.
Sub Procedure takes Arguments, simply Arguments are optional.
Sub Procedure won't provide whatever value.
Syntax:
-----------
Sub procedureName (Argumnets)
Statements
-----------
---------
---------
End Sub
----------------------------------------------------
b) Function Procedures
Set of statements enclosed alongside Function together with End Function statements to perform an Operation.
Function Procedure takes Arguments, simply Arguments are optional
Function Procedure Can provide a value.
Syntax:
Function procedureName (Arguments)
Statements
-----------
-------------
------------
End Function
Note: Sub procedures are faster inwards Execution than Function Procedures.
--------------------------------------------------------------
Access Modifiers
Public
Private
-----------------
Usage of Functions
Internal - Defining together with calling inside the script
External - Calling from external library files.
-------------------------------------------------