Determine the number of elements in an array

Results 1 to 2 of 2

Thread: Determine the number of elements in an array

  1. #1
    KPW Guest

    Default Determine the number of elements in an array

    In VBScript, is it possible to determine the number of elements in an array by accessing some property of the array, as in<BR><BR>iElements = [array name].length<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Determine the number of elements in an array

    Yes, you use a function named UBound to find the greatest index of your array, and a function named LBound to find the smallest.<BR><BR>I am assuming you are creating an array, then rediming it, and want to know at some point the current size of the dynamic array? Just do this:<BR><BR>iElements = UBound(array_name)<BR><BR>Happy Programming!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •