Print Page | Close Window

Randomise

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=8126
Printed Date: 01 April 2026 at 4:24am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Randomise
Posted By: rob_andy
Subject: Randomise
Date Posted: 16 December 2003 at 2:05am

I have an asp application that call entries from a database, at the moment each record in the db have a unique numerical ID e.g. 1,2,3 etc... At the moment the application loops through these in order, however, I would like to randomise this so that each time a person uses the app they get a different order with no repeats in a cycle.  At the moment the app works by starting with ID = 1 and then reloading the page with ID + 1 each time until the last record.  My initial thoughts would be creating a global array but have no idea where to start.  Any help is most appreaciated.  You can email me using :

mailto:rob@sheffcruise.com - This Link

 




Replies:
Posted By: MorningZ
Date Posted: 17 December 2003 at 11:16am

why would we email?  this is a forum to post questions and answers publically so all can give input/learn

as for your solution.. look in the Database forum for threads on retrieving data in random order



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: pmormr
Date Posted: 17 December 2003 at 6:02pm
this is a pretty decent random number generator that you can use to get a random record to start with

   'Set Randomizer function that returns a pesudo random
   'number
   Function random ()
   RANDOMIZE
   Dim randomnum
   randomnum = (rnd(1)) * 123456
   random = Round(randomnum)
   end function


-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: rob_andy
Date Posted: 19 December 2003 at 2:20am

Thanks very much pmormr, most helpful.  I posted this in the ASP discussion forum because I didn't believe it was a database issue, more of an ASP issue.  MorningZ, somtimes forums get clutered with useless rubbish when people ask questions etc...  In future I will remember your comments, you could have used the link to tell me off and not the forum.

Thanks again.



Posted By: MorningZ
Date Posted: 19 December 2003 at 5:34am
Originally posted by rob_andy rob_andy wrote:

Thanks very much pmormr, most helpful.  I posted this in the ASP discussion forum because I didn't believe it was a database issue, more of an ASP issue.  MorningZ, somtimes forums get clutered with useless rubbish when people ask questions etc...  In future I will remember your comments, you could have used the link to tell me off and not the forum.

Thanks again.


first off.. my explaination that this was a forum was because of the last bit of your original post, "You can email me using"

as if you were expecting someone to just email you the answer

secondly.. i was trying to help you by telling you their were a few threads in this database on this same exact topic and have answers to your problem on there already!

Sorry if you think that wasn't enough, i wasn't aware i owed you anything... next time i'll do your legwork for you i guess since that is what you expect of me



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: rob_andy
Date Posted: 22 December 2003 at 8:59am

What a way to waste peoples time.



Posted By: KCWebMonkey
Date Posted: 22 December 2003 at 9:27am
Originally posted by rob_andy rob_andy wrote:

What a way to waste peoples time.

I don't think you should be criticizing MorningZ, he was just trying to help you get the answer you need, without just giving you the answer like a baby needing a bottle.



Posted By: Semikolon
Date Posted: 22 December 2003 at 10:54am

MorningZ is a good asp/asp.net coder.. you should respect him, you may need his help in the future..

and MorningZ is not the one who wastes peoples time, in this topic, it was you that didnt search before you asked..




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net