VBS TUTORIAL: VBScript statement-property get statement _vbs

Source: Internet
Author: User
Tags naming convention

Property Get Statement

In the Class block, declare the name, parameters, and code of the body that constitutes the property procedure that is used to obtain (return) the value.

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

Parameters

Public

Indicates that the property Get procedure can be accessed by other procedures in all scripts.

Default

Used only with the Public keyword, indicates that the attribute defined in the Property Get procedure is the absence of a class.

Private

Indicates that the property Get procedure is accessible only to other procedures in the Class block in which it is defined.

Name

The name of the Property Get procedure, followed by a standard variable naming convention only if it can be associated with a property let or property Set procedure in the same Class block.

ArgList

The list of variables represents The arguments that are passed to the Property Get procedure when it is invoked. Multiple parameters are separated by commas. The name of each parameter in the Property Get procedure must be the same as the corresponding parameter in the Property Let procedure, if any.

Statements

Any set of statements that will be executed in the body of the Property Get procedure.

Set

The keyword to use when the object is returned as a property Get procedure.

Expression

The return value of the Property Get procedure.

Description

If you are not explicitly declared with public or private , the Property Get procedure is default to common, that is, they are visible to all other procedures in the script. The value of a local variable in a Property Get procedure is not saved between different procedure calls.

The Property Get procedure cannot be defined inside any other procedure, such as a Function or Property let.

The Exit Property statement causes an immediate exit from the Property Get procedure. The program will continue to execute after the statement that calls the Property Get procedure. The Exit Property statement can appear anywhere in the property Get procedure, not limited to the number of times.

Like a Sub and a Property Let procedure , a Property Get procedure is a process that accepts parameters, executes a series of statements, and changes the value of a parameter. However, unlike Sub and property lets, a Property get procedure can be used to the right of an expression, using a Function Returns the value of a property in the same way as a property name.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.