Random File Reads..

Results 1 to 3 of 3

Thread: Random File Reads..

  1. #1
    Join Date
    Dec 1969

    Default Random File Reads..

    I have looked over at ASP FAQs but the closest thing I can find to this topic is how to randomly shuffle things like a deck of cards....<BR><BR>I am looking for a way to:<BR><BR>Open up a file that contains quotes.<BR>Choose a quote.<BR>Read it from start --&#062; finish.<BR>Output it to the screen...<BR><BR>The only problem I can find with this is that some quotes will take up more than one line in the file, So there would have to be some way to read it from beginning to end.<BR><BR>If anyone could point me in the right direction or provide any other assistance, It would be much appreciated!<BR><BR>Thanks in advance.

  2. #2
    Join Date
    Dec 1969

    Default RE: Random File Reads..

    so delimit the quotes

  3. #3
    Join Date
    Dec 1969

    Default Stop using a file

    Horrible "expense" to read a file every time, just to get one line (or group of lines) from it.<BR><BR>As the other person suggested, delimit the quotes in some other way (e.g., ### between each quote?).<BR><BR>But then store all the quotes in an application variable (as an array!) and then simply pick a random element of the array.<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