Results 1 to 3 of 3

Thread: End Of Array?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517
    How do you get the last number of a array?
    so I could do this

    Dim Array() as string
    Dim lastnum as integer

    lastnum = lstarr(array())

    debug.print array(lastnum)

    and it would print the last string
    in the array

    Thanks!

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Use Debug.Print theArray(UBound(theArray))

    That should do it.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Lowest is LBound
    Highest is UBound

    Code:
    Dim myArray(4)
    For i = 1 To 4
    myArray(i) = i
    Next i
    
    MsgBox myArray(UBound(myArray))
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

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



Click Here to Expand Forum to Full Width