Put VBScript into one of its extreme applications (array)!!! _vbs

Source: Internet
Author: User
As we all know, VB has been widely used, the reason is that he learned the simple application of convenient, using Actviv x (OLE) technology, almost omnipotent, but that can not be called the standard language, in the N Some aspects is also notorious call, VBScript derived from the VB grammar, Base truth up Vb,vbscript if my high school is Hou, then his very good predecessor is Basic,qbasic,trubo Basic are different versions of Basic.
VBScript as a scripting language, then the person who has studied basic must not be unfamiliar to him, he is Vb,basic's brother, but how many people have the depth of understanding. Let's take a look at his array!
Maybe a lot of people would know
Dim A (3) can define a one-dimensional array with three subscript variables
Dim a (3,4) can define a two-dimensional array of three rows and four columns
Dim A (3,4,5) can define a three-dimensional array
Up to 60 dimensions
Dim a () can define a dynamic array
Use ReDim A (3) to reallocate storage space!
ReDim Preserve A (5) can redistribute the storage space while the data is not lost.
These are the canonical applications of arrays, and I think most of them are very familiar with it.

So has anyone ever used it? Examples are as follows:

Dim A (3)
Dim B (4)
A (0) =b
The above code does not error the result is UBound (a (0)) is 4, stating that a (0) is an array. This is like using a one-dimensional array in JS to form a two-dimensional or multidimensional array.

Then modify the above code:
Dim A (2)
Dim B ()
ReDim B (3)
A (0) =b
ReDim B (5)
After the execution of the above code, UBound (A (0)) is 3, stating that a (0) is not a reference to B, but instead allocates an array space for a (0).

You can see that the variables in VBScript are characteristic of any data type, that is, the variables in my JS are not similar in type.

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.