SitePoint Sponsor

User Tag List

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

    How do i count the number values seperated by commas

    hello,
    how do i count the number of values sent accross the form post seperated by commas ?

    e..g
    43352352,325324452,235234452,24523454

    thanks
    Afrika
    Last edited by afrika; Mar 11, 2005 at 05:38.

  2. #2
    SitePoint Addict rokc's Avatar
    Join Date
    Oct 2004
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this might help u..
    Code:
    jumvar = 43352352,325324452,235234452,24523454
    jumvarsplt = split(jumvar,",")
    valnum = CInt(ubound(jumvarsplt))

  3. #3
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi Rokc,
    thanks a lot

    Afrika

  4. #4
    Afrika
    Join Date
    Jul 2004
    Location
    Nigeria
    Posts
    1,737
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh by the way, what if the users, didnt type multiple choices, would this script throw an error

    e.g how do i differenciate if he typed just 2542542543 or if he typed multiple 2523452,2452452,5245245,4254232

    or do i test first to see if a comma exists and how do i achieve this efficiently ?


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
  •