JScript Method-Dimensions method

Source: Internet
Author: User
Tags array html page
Js|jscript returns the number of dimensions of the VBArray.

Array.dimensions ()

The required option array parameter is a VBArray object.

Description
The dimensions method provides a way to get the specified number of VBArray dimensions.

The following example includes three sections. The first part is the VBScript code used to create a Visual Basic safe array. The second part is JScript generation
Code to determine the dimensions of the safe array and the upper bound of each dimension. Both parts are placed in the <HEAD> section of the HTML page. The third part is located in the <BODY> part
JScript code to run the other two parts.

<HEAD>
<script language= "VBScript" >
<!--
Function Createvbarray ()
Dim I, J, K
Dim A (2, 2)
K = 1
For i = 0 to 2
For j = 0 to 2
A (j, i) = k
K = k + 1
Next
Next
Createvbarray = A
End Function
-->
</SCRIPT>

<script language= "JScript" >
<!--
function Vbarraytest (VBA)
{
var i, S;
var a = new VBArray (VBA);
for (i = 1; I <= a.dimensions (); i++)
{
s = "The upper bound of dimension";
s + = i + "is";
S + + a.ubound (i) + ".<br>";
}
return (s);
}
-->
</SCRIPT>
</HEAD>

<BODY>
<script language= "JScript" >
document.write (Vbarraytest (Createvbarray ()));
</SCRIPT>
</BODY>
Requirements
Version 3


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.