Holamundo.asp
Page source
random test
The current time is
6:28:40 AM
Howdy, World!
Today's date is 8/26/2005
Script listing
random test
The current time is
<%
response.write(time() & "
")
dim intSel 'an integer 0, 1, or 2
randomize
intSel = Int(3 * rnd()) 'select the random integer
Select case intSel
Case 0
response.write ("Hello, World!
")
Case 1
response.write ("Howdy, World!
")
Case 2
response.write ("Hola, Mundito!
")
End Select
response.write ("
Today's date is " & date())
%>
Explanation
The program portion of this page is several lines long. It writes the current time to the response object, then generates a random number (intSel) between 0 and 2.
The value of intSel determines which of three messages will be written to the response object using a Case statement.
The final response.write statement outputs the current date.
Note that this example includes only one program segment (between < and >). One may place any number of program segments in an ASP page.