Testing for Empty Arrays


/ Published in: ASP
Save to your folder(s)

Checks if an array has been initialized, even if it is a dynamic array.


Copy this code and paste it in your HTML
  1. '****************************************
  2. ' Checks if an array has been initialized, even if it is a dynamic array.
  3. '
  4. ' Got this from http://en.wiki.mcneel.com/default.aspx/McNeel/RsEmptyArray
  5. '****************************************
  6.  
  7. Function IsArrayDimmed(arr)
  8. IsArrayDimmed = False
  9. If IsArray(arr) Then
  10. On Error Resume Next
  11. Dim ub : ub = UBound(arr)
  12. If (Err.Number = 0) And (ub >= 0) Then IsArrayDimmed = True
  13. End If
  14. End Function

URL: http://en.wiki.mcneel.com/default.aspx/McNeel/RsEmptyArray

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.