O'Reilly logo

VBScript in a Nutshell, 2nd Edition by Ron Petrusha, Matt Childs, Paul Lomax

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Property Get Statement

Syntax

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

Use: Optional

Type: Keyword

Makes the property accessible from outside the class, giving it visibility through all procedures in all scripts. Public and Private are mutually exclusive.

Default

Use: Optional

Type: Keyword

Used only with the Public keyword to indicate that a public property is the default property of the class.

Private

Use: Optional

Type: Keyword

Restricts the visibility of the property to those procedures within the same Class...End Class code block. Public and Private are mutually exclusive.

name

Use: Required

The name of the property.

arglist

Use: Optional

Data Type: Any

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

statements

Use: Optional

Program code to be executed within the property.

expression

Use: Optional

Variant Type: Any

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

arglisthas the following syntax:
[ByVal | ByRef] argname[( )]
ByVal

Use: Optional

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

ByRef

Use: Optional

The argument is passed by reference; that is, the local variable is simply a reference to the argument being passed. Changes made to the local variable are reflected in the argument. ByRef is the default way of passing variables.

argname

Use: Required ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required