Vbs Tutorial: VBScript statement-dim statement

Source: Internet
Author: User

Dim statement

Declare variables and allocate buckets.

DimVarname [([subscripts])] [, varname [([subscripts])]...

Parameters

Varname

Variable name, which complies with the naming conventions of standard variables.

Subscripts

The dimension of the array variable. up to 60-dimensional arrays can be declared.SubscriptsThe parameters use the following syntax:

Upperbound [, upperbound]...

The lower bound of the array is always 0.

Description

UseDimDeclared script-level variables can be used in all processes in the script, and process-level variables can only be used in the process.

It can also contain parentheses.DimStatement to declare a dynamic array. After declaring a dynamic array, you can useRedimStatement to define the dimension and element of the array. If you try to redefineDimAn error occurs when the dimension array has been explicitly specified in the statement.

Note:UseDimStatementDimStatement at the beginning of the process.

The following example illustrates how to useDimStatement:

DimNames (9 )'Declare10Array of elements.DimNames ()'Declare a dynamic array.DimMyvar, mynum'Declare two variables.

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.