JScript Method-LBound method

Source: Internet
Author: User
Js|jscript returns the minimum index value used in the specified dimension of VBArray.

Safearray.lbound (Dimension)

Parameters
SafeArray

Required option. is a VBArray object.

Dimension

Options available. The dimension of the VBArray to be notified of the lower bound of its index. If omitted, LBound handles the parameter as 1.

Description
If VBArray is empty, the LBound method returns undefined. If the dimension is greater than the VBArray dimension or is a negative number, the method produces a
A "subscript out of Bounds" error.

Example
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 lower bound of each dimension. Since the safe array was created in VBScript rather than visual Basic, the lower bound begins
The end is 0. Both parts are placed in the <HEAD> section of the HTML page. The third part is the JScript code located in the <BODY> section, which is used to run the other two
Part.

<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 lower bound of dimension";
s + = i + "is";
S + + a.lbound (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.