Programm code caching?

Discussion in 'Classic ASP' started by gm, Dec 3, 2003.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. gm

    gm

    In case of using the construction of the following type:

    <a href="find.asp?w=<%=RND()%>">Next</a>

    the operator <%=RND()%> teturnes the only value, that does't change
    after reload.
    I use the classic ASP (not NET).
    By what means we can cansel cashing of the programm code that can be seen at any case.
    Help me pls!
     
  2. Yep, it is a weird function in asp. Accoring to the language reference of VBScript, this is the Rnd() function : quote:
    Rnd Function
    Returns a random number.

    Rnd[(number)]

    The number argument can be any valid numeric expression.

    Remarks
    The Rnd function returns a value less than 1 but greater than or equal to 0. The value of number determines how Rnd generates a random number:

    If number is Rnd generates
    Less than zero The same number every time, using number as the seed.
    Greater than zero The next random number in the sequence.
    Equal to zero The most recently generated number.
    Not supplied The next random number in the sequence.
    </blockquote id="quote"></font id="quote">
    So, according to this explanation, using Rnd(x) with x > 0 or not supplied should give you another generated number. I did some tests but that didn't work. However, using Rnd(-Second(now)) did provide me a different generated number each time I refreshed the page ... [:)]

    So try out this, and you should be fine:
     
  3. use this command to "reseed" the RND function

    Randomize Timer

    followed by your code, i.e.

    yourvariable = Int(RND * 10) + 1

    will return a random number between 1 and 10.

    dw
     
  4. gm

    gm

    Thank you very much for your help![:)]
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page