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 7 of 7

Thread: Array count

  1. #1
    Senior Coder crmpicco's Avatar
    Join Date
    Jan 2005
    Location
    Mauchline, Scotland
    Posts
    1,096
    Thanks
    15
    Thanked 1 Time in 1 Post

    Question Array count

    Code:
    sMyArray_5 = Array("Adult Net Net","Weekend Supp.","Pre-Addon","Markup","Agent Markup","Agent Markup (before VAT)","Tax (17.5%)","Gross Fare","Fuel Surcharge","Tax","TOTAL")
    How can i count how many values are stored in this array?

    Picco

  • #2
    Senior Coder crmpicco's Avatar
    Join Date
    Jan 2005
    Location
    Mauchline, Scotland
    Posts
    1,096
    Thanks
    15
    Thanked 1 Time in 1 Post
    This doesnt work:
    Code:
    arr_count = count(sMyArray_5)

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    upperBound = Ubound(sMyArray_5)

    For references to other methods and properties, just visit www.devguru.com or www.w3schools.com. You've been posting simple questions that can be answered easily by referring to those resources.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #4
    Regular Coder Freon22's Avatar
    Join Date
    May 2005
    Location
    USA
    Posts
    287
    Thanks
    3
    Thanked 5 Times in 5 Posts
    Keep in mind that Response.Write UBound(sMyArray_5) will return 10 and your array has 11. Its because the count starts at 0, and glenngv is right you should spend a few weeks learning some of the simple stuf. There are hundreds of free teaching sites on vbscript. It will make your coding move along much faster and easyer.

  • #5
    Senior Coder crmpicco's Avatar
    Join Date
    Jan 2005
    Location
    Mauchline, Scotland
    Posts
    1,096
    Thanks
    15
    Thanked 1 Time in 1 Post

  • #6
    Regular Coder Freon22's Avatar
    Join Date
    May 2005
    Location
    USA
    Posts
    287
    Thanks
    3
    Thanked 5 Times in 5 Posts
    I don't think anyone is going to answer you on that thread. I looked at it and you can use the split function to break it at every : and that will give you an array. But from there you will have to trim it, and it look like the string will be changing sizes. So it is going to take someone writing a function that only take the values between : and /.

    Good Luck

  • #7
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,072
    Thanks
    4
    Thanked 8 Times in 8 Posts
    I answered the thread and showed you how to do it.


  •  

    Posting Permissions

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