VBScript Coding Conventions

Source: Internet
Author: User
Tags constant naming convention ranges
The contents are as follows:
First, constants, variables, objects, and procedure naming conventions
Ii. Code Annotation Conventions
Iii. text formatting and narrowing conventions
Iv. other agreements
First, constants, variables, objects, and procedure naming conventions
1. Regular, variable naming convention
A often, the name of the variable shall consist of words that can be used to represent the contents of the variable, and the first letter of each word should be capitalized.
b usually prefix the name of the variable with the usual, variable data type
c If the variable is an array, add "a" before the prefix of the data type;
If the elements in the array contain inconsistent data types, the prefix of the constant, variable data type should be written as "vnt"
d) The name of the constant preceded by the prefix "con_-"
(e) If it is a script-level constant, variable, precede the name of the constant, variable, prefix "s_-"
Example: a process-level constant that represents the maximum number of users allowed by the system, which can be named as follows
Con_intsystemmaxuser
Example: A process-level array constant, which stores the name of a product vendor, can be named as follows,
Con_astrsupplier
Example: a script-level constant indicating the name of the company or person currently using the system can be named as follows,
S_con_strsystemowner
Example: A process-level variable that indicates whether the data entered by the user is legitimate and can be named as follows.
Blnvalidinput
Example: A process-level array variable that stores various types of data that may be used, can be named as follows,
Avnttemp
Example: A script-level variable that represents the current page number in the paging display of data, which can be named as follows
S_intcurpageno
Attached: Data type prefix table
Data type data content description corresponding prefix example
Array a Astrcustomer
Boolean true or False bln BlnFound
Integer byt bytusercnt of Byte 0 to 255
Currency-922, 337, 203, 685, 477.5808 to 922, 337, 203, 685, 477.5807 digital cur curmyaccount
Date (time) represents the digital DTM dtmstartdate of a date between January 1, 100 and December 31, 9999 of A.D.
Double double-precision floating-point number 1. For negative numbers, the range ranges from -1.79769313486232E308 to -4.94065645841247E-3242. For positive numbers, ranges from 4.94065645841247E-324 to 1.79769313486232E308 dbl dbltolerance
Empty indicates that the amount of the definition is uninitialized for the number of digits, the default value is 0 for the string amount, and the default is ""//

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.