SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    split and ubound function: something is wrong

    hello,
    this code gives me one short of the ubound function, what is wrong ?

    e.g if i have 353425432,325423,2542354
    it gives me 2 instead of 3

    Code:
    jumvar = request.QueryString("one")
    jumvarsplt = split(jumvar,",")
    valnum = CInt(ubound(jumvarsplt))

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2005
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You realize that you start refrencing an array at 0, right?

    ie..

    0, 1, 2 -> 3 elements
    0, 1, 2, 3 -> 4 elements

    Code:
    jumvar = "353425432,325423,2542354"
    jumvarsplt = split(jumvar,",")
    valnum = CInt(ubound(jumvarsplt))
    
    Response.Write jumvarsplt(0) & "<BR>"
    Response.Write jumvarsplt(1) & "<BR>"
    Response.Write jumvarsplt(2) & "<BR>"
    Last edited by RhythmAddict; Mar 11, 2005 at 14:38. Reason: added a little code..

  3. #3
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh ok, thanks


Bookmarks

Posting Permissions

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