How can I get a count of the number of dimensions in an array? [Print this FAQ]
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.
Do you have a FAQ you'd like to suggest?
Suggestions? Comments? If so, send it in!
Also, if you'd like to be a FAQ Admin (creating/editing FAQs),
let me know! If you are looking for other FAQs, be
sure to check out the 4Guys
FAQ and Commonly Asked Messageboard Questions!