Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Randomise
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Randomise

 Post Reply Post Reply
Author
rob_andy View Drop Down
Newbie
Newbie


Joined: 21 February 2003
Location: United Kingdom
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote rob_andy Quote  Post ReplyReply Direct Link To This Post Topic: Randomise
    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 :

This Link

 

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
rob_andy View Drop Down
Newbie
Newbie


Joined: 21 February 2003
Location: United Kingdom
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote rob_andy Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
rob_andy View Drop Down
Newbie
Newbie


Joined: 21 February 2003
Location: United Kingdom
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote rob_andy Quote  Post ReplyReply Direct Link To This Post Posted: 22 December 2003 at 8:59am

What a way to waste peoples time.

Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post 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..

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.