VBS TUTORIAL: VBScript statement-property Set statement _vbs

Source: Internet
Author: User
Tags naming convention

Property Set Statement

In the Class block, declare the name, parameters, and code, which constitute the body of the property procedure that sets the reference to the object.

 [Public | Private] Property Set name(
 
[arglist,] reference

)

[statement]
    [Exit Property]
    [statement]
End Property

Parameters

Public

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

Private

Indicates that the property Set procedure can only be accessed by other procedures in the same Class block that is declared.

Name

The name of the property Set procedure, followed by a standard variable naming convention, but the name can be associated with the Property Get or property letClass block The c12> process is the same.

ArgList

A list of variables that represents the arguments passed to it when the property Set procedure is invoked. Multiple parameters are separated by commas. Additionally, the propertyset procedure will always have one more argument than its corresponding property-get procedure. This extra argument is given to the object.

Reference

Variable that contains the object reference to the right of the object reference assignment.

Statement

Any set of statements that will be executed in the body of the property Set procedure.

Note Each property Set statement must define at least one parameter for the defined procedure. When a procedure defined by a property Set statement is invoked, the required parameter, which is the last argument when multiple arguments are made, provides the actual object reference for the attribute. In the previous syntax, this argument is referred to as a reference.

Description

Unless explicitly specified with public or Private, the property set procedure is set to the default common mode, where all other procedures in the script are visible. When different procedure calls, local variables in the propertySet procedure are not saved.

The property Set procedure cannot be defined in any other procedure, such as a function or Property let.

The Exit Property statement causes an immediate exit from the property Set procedure. The program continues to execute the statement after the property Set procedure is invoked. The number of the Exit Property statement is unrestricted and can appear anywhere in the property Set procedure.

As with Function and Property Get procedures, the property Set Procedure is a separate process that can have several parameters, execute a series of statements, and change the value of the parameter. However, unlike function and Property Get procedures, both functions and procedures can return a value, while the property Set Procedure object references the left side of the assignment (the Set statement).

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.