[Import] common ASP functions: DelArray2 ()

Source: Internet
Author: User

<%
'Function: Delete the row with the value of sValue in the iColumn of the Two-dimensional array. When the value of iColumn is-1, delete the row sValue.
'Source: http://jorkin.reallydo.com/article.asp? Id = 483

Function DelArray2 (aArray, iColumn, sValue, bCompare)
If Not IsArray (aArray) Then Exit Function
Dim I, j, k, iUBound1, iUBound2
IUBound1 = UBound (aArray)
IUBound2 = UBound (aArray, 2)
K =-1
Dim aTmpArray ()
ReDim aTmpArray (iUBound1, k)
If iColumn <0 Or iColumn> iUBound1 Then
For I = 0 To iUBound2
If StrComp (I, sValue, bCompare) <> 0 Then
K = k + 1
ReDim Preserve aTmpArray (iUBound1, k)
For j = 0 To iUBound1
ATmpArray (j, k) = aArray (j, I)
Next
End If
Next
Else
For I = 0 To iUBound2
If StrComp (aArray (iColumn, I), sValue, bCompare) <> 0 Then
K = k + 1
ReDim Preserve aTmpArray (iUBound1, k)
For j = 0 To iUBound1
ATmpArray (j, k) = aArray (j, I)
Next
End If
Next
End if
Delarray2 = atmparray
End Function
%>

Source: http://Jorkin.Reallydo.Com/default.asp? Id = 483

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.