Easy beginner question with RND

Results 1 to 2 of 2

Thread: Easy beginner question with RND

  1. #1
    Corin Guest

    Default Easy beginner question with RND

    I want to generate a random number between 1-10, I use;<BR><BR>&#060;%<BR>Dim whichLink, upperBound, lowerBound<BR><BR>upperBound = 1<BR>lowerBound =10<BR><BR>whichLink = Int((upperbound - lowerbound + 1) * Rnd + lowerbound)<BR><BR>If whichLink &#060;=10 Then<BR>Response.write ("&#060;IMG SRC=&#039images/z104bl.jpg&#039&#062;")<BR><BR>End If<BR><BR>Response.write (whichLink & "<BR>")<BR><BR><BR>%&#062;<BR><BR>But I always get the number 4, help if you can.<BR><BR>Thanks in advance

  2. #2
    Corin Guest

    Default Figured it out

    I was forgetting Randomize and my variables didn&#039t match up. Works now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts