VBS Tutorial: VBscript-Property Get statement

Source: Internet
Author: User

Property Get statement

InClassBlock, the Declaration constitutes the value used to obtain (return)AttributeThe name, parameters, and code of the process subject.

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

Parameters

Public

IndicatesProperty GetThe process can be accessed by other processes in all scripts.

Default

OnlyPublicKeyword used together, indicatingProperty GetThe attribute defined in the process is the default attribute of the class.

Private

IndicatesProperty GetThe process only defines itsClassOther processes in the block are accessible.

Name

Property GetThe name of the process. Follow the standard variable naming rules. The difference is that it can be the sameClassBlockProperty LetOrProperty SetProcess.

Arglist

The Variable list representsProperty GetThe parameter passed to the process when it is called. Multiple parameters are separated by commas.Property GetThe name of each parameter in the process must beProperty LetThe parameters in the process are the same (if any ).

Statements

Any group of statements will beProperty GetThe process is executed in the main body.

Set

When the object isProperty GetThe keyword used in the return value of the process.

Expression

The return value of the Property Get process.

Description

If Public or Private statements are not usedProperty GetBy default, processes are common, that is, they are visible to all other processes in the script.Property GetThe values of local variables in a process are not saved between different process calls.

The Property Get process cannot be defined within any other process (such as a Function or Property Let.

The Exit Property statement will immediately Exit the Property Get process. The program will continue to execute the program after the statement that calls the Property Get process. The Exit Property statement can appear in any position in the Property Get process, with no limit on the number of times.

AndSubAndProperty LetSimilar process,Property GetA process is a process that can accept parameters. It can execute a series of statements and change the value of parameters. HoweverSubAndProperty LetThe difference is that,Property GetThe process can be used to the right of the expression.FunctionOr return the property value in the same way as the 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.