_asp basis of UBound and Lubound in ASP

Source: Internet
Author: User
Tags naming convention

UBound function
Returns a Long data whose value is the maximum subscript available for the specified array dimension.

Grammar

UBound (arrayname[, Dimension])
The syntax for the UBound function contains the following sections:

Partial description
Arrayname is required. The name of the array variable, followed by the standard variable naming convention.
Dimension optional; Variant (Long). Specifies the upper bound of which dimension to return. 1 represents the first dimension, 2 represents the second dimension, and so on. If dimension is omitted, it is considered to be 1.

Description

The UBound function is used in conjunction with the LBound function to determine the size of an array. LBound is used to determine the upper bound of one dimension of an array.

For arrays with the following dimensions, the return value of the UBound is shown in the following table:

Dim A (1 to 0 to 3,-3 to 4)

Statement return value
UBound (A, 1) 100
UBound (A, 2) 3
UBound (A, 3) 4

The use of the ASP UBound () function returns the maximum available subscript for the indicated dimension of the array.

Such as:

Copy Code code as follows:

<%
Chkitems = Trim (Request ("chk"))
If Chkitems <> "" Then
Chkitem = Split (Chkitems, ",")
' For i=0 to UBound (Chkitem)
' Response.Write (Chkitem (i) & "<br/>")
' Next
Else
Response.Write ("Please select a vote!")
End If
%>

Because the split function will get the check box values to be separated by the delimiter ', ' split, in an array of data format, now to be output in turn, what are the options are selected, with a For loop, for the determination of the loop variable to use the UBound function

Related Article

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.