Friday 10, February 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    Forum    |    About Us    |    Contact Us

VBScript Procedures

We have two kinds of procedures: The Sub procedure and the Function procedure.

Sub procedure
A sub procedure is a series of statements, enclosed by the Sub and End Sub statements. It
can perform actions, but does not return a value. It can take arguments that are passed to it by a calling procedure. Sub procedures without arguments, must include an empty set of parentheses ()

Example:
Sub mysub()
 some statement(s)
End Sub

Example:
Sub mysub(arg1,arg2)
 Statement(s)
End Sub

Function procedure
A function procedure is a series of statements, enclosed by the Function and End Function statements. It can perform actions and can return a value. Function procedures can take arguments that are passed to it by a calling procedure. Without arguments, must include an empty set of parentheses (). They returns a value by assigning a value to its name.

Example
Function myfunction()
statement(s)
myfunction=some value
End Function

Example
Function myfunction(arg1,arg2)
Statement(s)
myfunction=some value
End Function

Calling a Sub or Function Procedure
Function name is used to call a function procedure. When you call a Function in your code, you do like this
Var_name = proc_name()

Here you call a Function called " proc_name", the Function returns a value that will be stored in the variable " Var_name".

Calling a sub procedure you can use the following statement.
Call Proc_name(arguments)
Or, you can omit the Call statement
Proc_name arguments

 
     
   
VBScript Tutorial
 
  Introduction
Introduction
  How to
How to
  Where to
Where to
  Working With Variables
Working With Variables
  Arrays
Arrays
  VBScript Procedures
VBScript Procedures
  Conditional Statements
Conditional Statements
  For Next Loop
For Next Loop
  While Loop
While Loop
  Comments
Comments
  Date
Date
  MsgBox
MsgBox
 
 
 
Web Designing Tutorials
  HTML Tutorial
HTML Tutorial
  DHTML Tutorial
DHTML  Tutorial
  CSS Tutorial
CSS Tutorial
  XHTML Tutorial
XHTML Tutorial
 
Programming Languages Tutorials
  C Language Tutorial
C Language Tutorial
  C++ Tutorial
C++ Tutorial
  Java Language Tutorial
Java Language Tutorial
  Data Structure Theory Tutorial
Data Structure Theory Tutorial
 
Server Side Scripting Tutorials
  PHP Tutorial
PHP Tutorial
  SQL Tutorial
SQL Tutorial
  ASP Tutorial
ASP Tutorial
 
Client Side Scripting Tutorials
  JavaScript Tutorial
JavaScript Tutorial
  VBScript Tutorial
VBScript Tutorial
 
 
 
POPULAR E-BOOKS
 
Download PDQCash Ebook PDQCash
   
Download Concrete Abstractions - An Introduction to Computer Science Using Scheme  Ebook Concrete Abstractions - An Introduction to Computer Science Using Scheme
   
Download Optimizing C++ Ebook Optimizing C++
   
Download 7 Great Lies of Network Marketing Ebook 7 Great Lies of Network Marketing
   
Download How To Get Rich From Any MLM Program Ebook How To Get Rich From Any MLM Program
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz