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