Advertisement
2002VB Data Structures #17256

Check if dynamic array dimensioned already

Tells if a dynamic array has been dimensioned or not. Lu

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Function Member(ary$(), text$)
  On Local Error GoTo MemberExit
  For i = 1 To UBound(ary$)
    If text$ = ary$(i) Then
      subscript = i
      Exit For
    End If
  Next
MemberExit:
  Member = subscript  
End Function
;========================================
another possibility;
Function ArrayElements(ary$())
  elements = 0    
  On Local Error GoTo MemberExit
  elements = UBound(ary$)
MemberExit:
  ArrayElements = elements
End Function
Original Comments (3)
Recovered from Wayback Machine