VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Check if dynamic array dimensioned already

by Newsgroup Posting (15 Submissions)
Category: Data Structures
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (38 Votes)

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

Rate Check if dynamic array dimensioned already

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

Download this snippet    Add to My Saved Code

Check if dynamic array dimensioned already Comments

No comments have been posted about Check if dynamic array dimensioned already. Why not be the first to post a comment about Check if dynamic array dimensioned already.

Post your comment

Subject:
Message:
0/1000 characters