HTML Help
HTML Help Central . com

» Online Users: 83

0 members and 83 guests
No Members online
Most users ever online was 695, 02-16-2011 at 07:01 AM.

» Site Navigation

 > FAQ

» Domains For Sale

Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2005
    Posts
    20

    Best way to do a HUGE comparison

    Basically I am helping write a 'page' for research. The study will eventually have 45 questions. I have a loop running (need to randomize the 45 questions) that basically pulls a randome number(1-45), if the question associated with the random number has already been asked, it loops, pulls another random number, at the end, to end(or exit) the loop I will have a compasison that basically checks to see if there s an answer in the 45 data slots (was using cookies with keys, might switch to db.)

    What is the best way to do this comparison, an "IF THEN ELSE" with 45 checks(ie IF A1 = true AND A2 is = true, ... AND A45 = true THEN..)? Case select (not sure how to do that but it might work faster) Better to do these comparisons with cookies or a db?

    Open to ideas..

    Thanks,
    Kynn

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    591
    Create a counter variable and add one to it everytime a question is asked, then once your counter reaches a certain value exit the loop.

    example pseudocode:

    counter = 0

    do
    get random number
    pull question
    if(question not already asked)
    {
    counter++;
    ask question
    }
    while counter != 45

    As far as the syntax goes in ASP you've got the wrong person here

Similar Threads

  1. How to make a price comparison site
    By ojsimon in forum Javascript / AJAX / VBScript
    Replies: 3
    Last Post: 05-20-2007, 10:07 AM
  2. Huge Question
    By tropical234 in forum HTML / XHTML / XML
    Replies: 2
    Last Post: 06-29-2005, 05:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBadvanced CMPS v4.1.1