Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Oct 2004
    Location
    In front of this computer. (Where else?)
    Posts
    442
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Variable length arrays

    Hi Guys,
    I have a table in my database which have true/false values. I want to read a set of values and store them in an array if true. After i do that i'll display them on a page. The reason i want to use an array is that i want to seperate each of the values with commas and end with a full stop and with an array, i can easily do that.
    No i'm not sure of the size of the array because i don't know how many values in the database have a value of true. Is there a way to have an array without knowing how many values it will contain?
    Thanks.

  • #2
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    you can use UBound(arrArrayName) for the length of the array, loop until that and end with a . (LBound is the start of an array but its usually 0 unless the array is empty in which case its -1 i think)

    but you seem to be quite good at asp so i doubt u are asking that

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    Texas
    Posts
    287
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can define it as a certain size, and if needed, expand it:
    dim myarray(100)

    ....find out you need more:...

    ReDim Preserve myarray(999)




    fv

  • #4
    Regular Coder
    Join Date
    Oct 2004
    Location
    In front of this computer. (Where else?)
    Posts
    442
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks ghell and fv, i got it figured out.
    The problem is I spent all my day coding and proofreading so when this problem came up at almost close of work, i couldn't get my brain to respond . (i needed to reboot )
    Quote Originally Posted by ghell
    but you seem to be quite good at asp so i doubt u are asking that
    Good? i don't think so. I still got guys i respect eg, ghell, etc.
    Thanks anyway.
    Last edited by tboss132; 02-08-2005 at 10:45 AM. Reason: typo


  •  

    Posting Permissions

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