Identifiers in vbs)

Source: Internet
Author: User

Vbs actually has two identifiers:

Normal identifier (normalidentifier)
Bracketidentifier)
However, I have read vbs books that only talk about common identifiers, without brackets.

We are already familiar with the rules for common identifiers:

The first character must be a letter.
It can be followed by letters, numbers, and underscores (_)
The length cannot exceed 255 characters
It cannot be a reserved keyword of vbs.
The rules for brackets are simpler:

Any Unicode characters enclosed in parentheses (except for line breaks, carriage returns, and null)
The length cannot exceed 255 characters (excluding brackets)
With the brackets identifier, you can use any character as the variable name, including vbs reserved words.

CopyCodeThe Code is as follows: dim [if], [nickname]
[If] = "Hello World"
[Nickname] = "demon"
Wscript. Echo [if]
Wscript. Echo [nickname]

In this way, you can use Chinese when naming variables or functions, which looks awesome.

Reference link:VBScript trivia: bracket identifiers and reserved word incompatibilities
Original article: 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.