can you get a count from the collection object

Results 1 to 3 of 3

Thread: can you get a count from the collection object

  1. #1
    Join Date
    Dec 1969

    Default can you get a count from the collection object

    i using a check box on a page and wanted to know can i use the collection object to tell how many boxes where checked. So i would know how many times i would have to iterate through them.<BR><BR>I can do a for next but i need to know the exact number so that i can do the following<BR><BR>update due_evals set eval_type = &#039;test&#039; <BR>where due_evals_id in (&#039;11&#039;,&#039;22&#039;,&#039;33&#039;)<BR> <BR>if i know how many times then i i will know if i need to put another comma or quote.

  2. #2
    Join Date
    Dec 1969

    Default the way I do this

    is to add the comma in FRONT, omitting to add it on the first pass<BR><BR>for loop [<BR> if(first_iteration) [<BR> concat number<BR> ] else [<BR> concat &#039;, &#039; + number<BR> ]<BR>]<BR><BR>it&#039;s just as easy.<BR><BR>j<BR>

  3. #3
    Join Date
    Dec 1969

    Default ASPFAQs give a better way...

    The link to the ASPFAQs is at the top right corner of most every page on this site, including the one you are reading now.<BR><BR>Look in the category "Databases, Queries" to find this one:<BR><BR><BR><BR>No counting needed!<BR><BR>p.s.: Yes, you can get the count from the collection.<BR><BR>Example:<BR><BR>&#060;%<BR>cnt = Request.Form("checkBoxGroupName").Count<BR>For i = 1 To cnt &#039; don&#039;t ask me why, but it starts at 1, not zero<BR>&nbsp; &nbsp; Response.Write i & ": " & Request.Form("checkBoxGroupName")(i) & "&lt;BR&#062;"<BR>Next<BR>%&#062;<BR><BR>

Posting Permissions

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