ASPFAQs.com
Your source for ASP-related frequently asked questions and answers!


4GuysFromRolla.com : ASP FAQS : Arrays

Question: How can I get a count of the number of dimensions in an array?

Answer: There is no native VBScript method for getting the number of dimensions in a VBScript safe array. However JScript, ironically, has such a function in order to help it better integrate with VBScript:

<script language="JScript" runat="server">
    function CountDims(arrVBArray) {
        return arrVBArray.dimensions();
    }
</script>


Used like this:

<%
    Dim arrTest(4, 9)

    ' Returns 2:
    Response.Write CountDims(arrTest)
%>


FAQ posted by Richard Lowe at 12/1/2000 12:43:26 AM to the Arrays category. This FAQ has been viewed 58,949 times.


Copyright 2017 QuinStreet Inc. All Rights Reserved.
Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers