Skip to Main Content
VBScript in a Nutshell, 2nd Edition
book

VBScript in a Nutshell, 2nd Edition

by Paul Lomax, Matt Childs, Ron Petrusha
March 2003
Intermediate to advanced content levelIntermediate to advanced
512 pages
14h 30m
English
O'Reilly Media, Inc.
Content preview from VBScript in a Nutshell, 2nd Edition

Name

Function Statement

Syntax

[Public [Default] | Private] Function name [(arglist)] [(  )] 
   [statements]
   [name = expression]
   [Exit Function] 
   [statements]
   [name = expression]
End Function
Public

Use: Optional

Type: Keyword

Indicates that the function is accessible in all scripts. If used in a class, indicates that the function is a member of the class’s public interface. Public and Private are mutually exclusive; Public is the default.

Default

Use: Optional

Type: Keyword

Defines a method as the default member of a class. It is valid only for a public function defined within a Class...End Class statement. Only one property or method in a class block can be defined as the default member of the class.

Private

Use: Optional

Type: Keyword

Restricts access to the function to other procedures in the script where it is declared. If the function is a member of a class, it makes the function accessible only to other procedures in that class.

name

Use: Required

The name of the function.

arglist uses the following syntax and parts:

Use: Optional

A comma-delimited list of variables to be passed to the function as arguments from the calling procedure.

statements

Use: Optional

Program code to be executed within the function.

expression

Use: Optional

The value to return from the function to the calling procedure.

arglist uses the following syntax and parts:
[ByVal | ByRef] varname[( )]
ByVal

Use: Optional

Type: Keyword

The argument is passed by value; that is, the local copy of the variable is assigned the value of the argument. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

VBScript in a Nutshell

VBScript in a Nutshell

Matt Childs, Paul Lomax, Ron Petrusha
Microsoft® PowerShell, VBScript and JScript® Bible

Microsoft® PowerShell, VBScript and JScript® Bible

William R. Stanek, James O'Neill, Jeffrey Rosen

Publisher Resources

ISBN: 0596004885Errata Page