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