The identifier in the VBS (IDENTIFIERS) _vbs

Source: Internet
Author: User
Tags reserved
VBS actually has two types of identifiers:

Generic identifier (Normalidentifier)
Bracket identifier (bracketidentifier)
But all the VBS books I've seen are just plain identifiers, without the bracket identifiers.

Rules for common identifiers we are already familiar with:

The first character must be a letter.
The characters that follow can be letters, numbers, and underscores (_)
Length cannot exceed 255 characters
Cannot be a key reserved by the VBS
The rules for the bracket identifiers are simpler:

Any Unicode character enclosed in brackets (except for newline, carriage return, and null)
Length cannot exceed 255 characters (excluding brackets)
With the bracket identifier, you can use any character to make the variable name, including the VBS reserved word

Copy Code code as follows:

Dim [if],[Nickname]
[If] = "Hello World"
[Nickname] = "Demon"
WScript.Echo [If]
WScript.Echo [Nickname]

When you give a variable or function a name, you can use Chinese, which looks pretty good.

Reference Links: VBScript trivia:bracket Identifiers and Reserved Word incompatibilities
Original: http://demon.tw/programming/vbs-identifiers.html

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.