Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Randomize in VBSCRIPT

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,45
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Randomize in VBSCRIPT
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Randomize in VBSCRIPT - 5/23/2001 9:31:29 PM   
  dropme

 

Posts: 18
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
I need to do something in VBSCRIPT, I am very new with it so any help would be great.

1.) button on web page
2.) when pressed it randomizes a number between 1 and 10
3.) does an if then else for under 5 and over 5
4.) if under 5 display a picture or over 5 displays a different picture
5.) adds 1 to a feild each time over 5 substracts 5 each time under 5
6.) displays a message that says "under or over 5" (you get the picture)

A demo of this is probably pretty simple, but appreciated

PLEASE HELP! Thanks
 
 
Post #: 1
 
 Re: Randomize in VBSCRIPT - 5/23/2001 9:32:44 PM   
  hennykoe

 

Posts: 9
Score: 0
Joined: 5/23/2001
From:
Status: offline
1-4:


randomize timer/rnd

function GiveNumber(nHigh)
GiveNumber=int(nHigh * rnd + 1)
end function

dim nValue
nValue = GiveNumber(10)

Response.Write "<form method=post action=example.asp>"
Response.Write "Random nummber: " & nValue & "<br>"
if nValue < 5 then
Response.Write "<img src=pic1.jpg>"
else
Response.Write "<img src=pic2.jpg>"
end if
Response.Write "<br><input type=submit value=Demo!></form>"

(in reply to dropme)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Randomize in VBSCRIPT Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts